Page 1 of 1

Moho, run script and get ScriptInterface instance (without menu/tool clicking)

Posted: Thu Aug 19, 2021 12:21 pm
by bwolf88
Hi guys !

I need to run Moho lua script which created new document, import some files etc., by command line.
The problem is: to call Run() function requered ScriptInterface instance. It may called by mouse clicking, by menu selection in Moho UI (hand made calling) and sending ScriptingInterface instance as function parameter, like script:Run(moho). If I trying to call this function from commandline this instance not set as parameter and I can't find and get global intance of this. So the question is - can I get ScriptInterface instance from some global vars or somehow else ??

Re: Moho, run script and get ScriptInterface instance (without menu/tool clicking)

Posted: Thu Aug 19, 2021 7:12 pm
by synthsin75
On Windows, I use AutoHotkey to activate Moho scripts using their assigned keyboard shortcut. And an AHK script can be run from the command line.
I often run AHK scripts, using the command line, from Moho Lua scripts.

The scripting API is not directly available to the command line.