Running scripts from external
Moderators: Víctor Paredes, Belgarath, slowtiger
-
graphicalglitch
- Posts: 2
- Joined: Wed Feb 04, 2026 12:45 pm
Running scripts from external
Is it possible to call a script, or call to the Moho API, from an external application? i.e. if we were using an external pipeline tool like AYON, is it possible to make an API call to Moho to load or save a file?
- synthsin75
- Posts: 10631
- Joined: Mon Jan 14, 2008 2:20 pm
- Location: Oklahoma
- Contact:
Re: Running scripts from external
Yes, but it depends on what you need to do. You can have an external app send shortcuts to Moho, through AHK, Python, etc., to save/open a file or activate a Lua script to do something more complex.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Re: Running scripts from external
You can also run Startup Command Line Scripts that execute on load.
The command is in the format: moho.exe MyFile.moho MyScript.lua
Currently, you need to fully qualify paths to both the Moho file and Script file.: i.e. <Moho Program Path>\moho.exe <file path>\MyFile.moho <script path>\MyScript.lua
There are also 2 examples provided with Moho: <Moho Program Path>\Resources\Support\Pro\Extra Files\Optional Scripts\Command Line Scripts
The command is in the format: moho.exe MyFile.moho MyScript.lua
Currently, you need to fully qualify paths to both the Moho file and Script file.: i.e. <Moho Program Path>\moho.exe <file path>\MyFile.moho <script path>\MyScript.lua
There are also 2 examples provided with Moho: <Moho Program Path>\Resources\Support\Pro\Extra Files\Optional Scripts\Command Line Scripts
Moho 14.5 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.5 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam
Moho 14.5 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam
-
gwhitaker62
- Posts: 7
- Joined: Thu Oct 22, 2026 9:50 pm
Re: Running scripts from external
SimplSam, did you get that command line bit working when the paths have spaces in them? i reckon that would be teh first thing to trip me up, as it usually does with anything on Windows... and does the script just run once on load, or can you get it to save and close Moho afterwards so a pipeline tool could actually use it?SimplSam wrote:You can also run Startup Command Line Scripts that execute on load.
-
graphicalglitch
- Posts: 2
- Joined: Wed Feb 04, 2026 12:45 pm
Re: Running scripts from external
This is sort of what I'm looking to do, I'd like to look into options for connecting pre-existing pipeline tools to Moho. A lot of my experience is through Python-based systems (i.e. AYON).synthsin75 wrote: ↑Mon Oct 26, 2026 11:00 am Yes, but it depends on what you need to do. You can have an external app send shortcuts to Moho, through AHK, Python, etc., to save/open a file or activate a Lua script to do something more complex.
Currently looking at just automating workfiles and reviewable publishing (i.e. sending a command just to say "save this file to here" or "export as a video file with these settings") as a starting point.
I suppose for those, best approach at least for now may be to have the scripts as .lua files, then have our pipeline tools call the Moho executable with the commandline script? Though was curious about this:
Is this just in reference to calling the Moho executable with extra arguments, or is it possible to call these directly via WebSocket or something similar?
- synthsin75
- Posts: 10631
- Joined: Mon Jan 14, 2008 2:20 pm
- Location: Oklahoma
- Contact:
Re: Running scripts from external
No, this is just to have an external script activate a Moho button script while Moho is already open.graphicalglitch wrote: ↑Wed Nov 04, 2026 6:42 am Though was curious about this:Is this just in reference to calling the Moho executable with extra arguments, or is it possible to call these directly via WebSocket or something similar?
Sam's advice above sounds more suited to what you're doing... plus using the command line renderer for export tasks.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/