
lua script for documents manger
Moderators: Víctor Paredes, Belgarath, slowtiger
Re: lua script for documents manger
Thank you so much. 

- hayasidist
- Posts: 3857
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: lua script for documents manger
I know slightly less than diddly squat about what AHK can do ... but ... is it possible for AHK to run moho and open the files?synthsin75 wrote: ↑Sat Jan 15, 2022 8:51 pm
1. Have the Lua script open all the files in Moho and launch the AHK script.
one "advantage" of Moho is that it opens a new tab (and doesn't start a new instance in a new window) when run many times from (e.g.) CMD>
so a loop in AHK of "run moho file<n>" will open tabs
===
or just an AHK loop of
(runwait) open the next file, run the LUA script, save the file, quit moho ??
- synthsin75
- Posts: 10280
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: lua script for documents manger
Yes, AHK could open Moho and all the files. Then you'd just have it send the shortcut for the Lua script that adds the comp, saves, and closes the active tab for each file.hayasidist wrote: ↑Sun Jan 16, 2022 12:27 pmI know slightly less than diddly squat about what AHK can do ... but ... is it possible for AHK to run moho and open the files?synthsin75 wrote: ↑Sat Jan 15, 2022 8:51 pm
1. Have the Lua script open all the files in Moho and launch the AHK script.
one "advantage" of Moho is that it opens a new tab (and doesn't start a new instance in a new window) when run many times from (e.g.) CMD>
so a loop in AHK of "run moho file<n>" will open tabs
===
or just an AHK loop of
(runwait) open the next file, run the LUA script, save the file, quit moho ??
You'd either have to add enough wait time, between AHK sending the next Lua shortcut to account for the CPU being slow or busy, or you just have the Lua script invoke the AHK script again, once it's done with each file.
And to be fair, you could probably do the same with Python as you can with AHK.
- 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/
- hayasidist
- Posts: 3857
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: lua script for documents manger
Can AHK call another AHK script?synthsin75 wrote: ↑Sun Jan 16, 2022 8:23 pm
Yes, AHK could open Moho and all the files. Then you'd just have it send the shortcut for the Lua script that adds the comp, saves, and closes the active tab for each file.
You'd either have to add enough wait time, between AHK sending the next Lua shortcut to account for the CPU being slow or busy, or you just have the Lua script invoke the AHK script again, once it's done with each file.
And to be fair, you could probably do the same with Python as you can with AHK.
If so, could it use a "run and wait" to fire off the LUA?
Or maybe the LUA can set a "Done" flag that the AHK script can poll?
- synthsin75
- Posts: 10280
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: lua script for documents manger
Yeah, AHK can call another AHK script, even passing arguments. You can even invoke an AHK script from Lua, passing arguments.hayasidist wrote: ↑Mon Jan 17, 2022 1:56 pm Can AHK call another AHK script?
If so, could it use a "run and wait" to fire off the LUA?
Or maybe the LUA can set a "Done" flag that the AHK script can poll?
The problem with having an AHK script wait is that the wait time is guesswork. AHK can wait for a particular window to exist, close, etc., but not be able to tell that a program is done doing a particular task.
Lua can probably set a flag for AHK, but that's something I haven't got around to experimenting with yet. I'm already familiar with Lua starting an AHK script with arguments.
EDIT: But AHK can tell when the Moho window title changes. So as soon as the Lua script closes a file, AHK would know and could invoke the script again, on the next file in the list.
- 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/
- hayasidist
- Posts: 3857
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: lua script for documents manger
thanks Wes. all useful stuff for me and anyone else trying to gain an understanding of AHK