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

General Moho topics.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
bwolf88
Posts: 3
Joined: Fri Aug 13, 2021 7:06 pm

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

Post 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 ??
User avatar
synthsin75
Posts: 10269
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

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

Post 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.
Post Reply