Running scripts from external
Moderators: Víctor Paredes, Belgarath, slowtiger
-
graphicalglitch
- Posts: 1
- 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: 10614
- 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.