Skip to content
Advertisement

Running one Autokey script from another Autokey script?

Right now I’ve got two Autokey scripts (for modularity), one that opens a file, and one that puts text in it.

The one that opens the file has hotkey F1 (and we’ll call this script 1 for simplicity), and the one that puts text in it has hotkey F2. I want a new Autokey script, that when I hit F3, it runs both the 1 script and the 2 script.

I’ve tried making the 3 script just send the F1 and F2 keys, but the timing is all off. It would be better if I could just call 1 and 2 from 3. Is this possible?

Thanks!

Advertisement

Answer

https://github.com/autokey/autokey/blob/fc7c6b90f3f28a57ad256829ef2b69e3be5148d2/lib/autokey/scripting.py#L1242

engine.run_script("<description>")

ought to do the trick

“Description” in this context is generally the name of the script in the side bar in the AutoKey interface. If you open up the .json file for the script you can see it for sure, but it will be the name displayed in the side bar unless you have duplicate names for scripts in the same folder or some other edge scenario

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement