V28.7.9 - MacOS - Setting a shortcut for Illistrator Scripts without the need of an Action
I’m trying to automate some production steps in Illustrator
My script uses:
app.doScript(ACTION_NAME, ACTION_SET_NAME)to trigger pathfinder and offset actions. When I run it manually (File -> Scripts -> My Script) it works perfectly.
However, when I make an Action that runs this script, Illustrator freezes as soon as it reaches any app.doScript() call.
I understand that Illustrator Actions and scripts run in different execution threads, and it seems like running an Action that runs a script that runs an Action causes a standstill.
I’ve tried alternatives like:
app.executeMenuCommand("OffsetPath")
//OR
app.executeMenuCommand("Live Offset Path")
//Then using expandStyle()but these don’t allow me to apply predefined offset settings automatically, so using an Action is still the only consistent and accurate approach so far. I've also tried using effects and even then that has shown unsuccessful results.
Ideally, I’d like to give my script its own keyboard shortcut so I can run it directly, without going through an Action (since that’s what causes the freeze, at least thats what I think is causing the issue).
Questions:
- Is there any supported way to assign a direct keyboard shortcut to a script in Illustrator without using an Action?
- Are there known workarounds or best practices for safely calling app.doScript() from a script triggered by an Action?
- Am I doing something wrong that I shouldn't be doing?
For now, I'm sticking with using other scripts shortcut key and then selecting the script.
Thanks for any clarification or insight.
