Skip to main content
Inspiring
January 26, 2023
Answered

Illustrator crashes when call action with app.doscript

  • January 26, 2023
  • 1 reply
  • 1955 views

Hi community, hope you're all doing great.

I need some help, whenever I execute my script from visual code (it is an UI dialog that executes app.Script) the script works great, but after copying that file to the script folder in AI and make it an action, it always crashes AI at the very specific moment I call an specific actions with app.doScript, it only works when I execute it from visual code.

 

Is there anybody who already have experimented this? Thank you

Correct answer jduncan

Yeah, this gets asked about once a week on here. Basically, Ai ExtendScript is single threaded so when you initiate a script from within an action (first thread) and that script tries to run another action (second thread) Ai hangs since it's waiting for the first action to end. If you try just running the script from File > Scripts it probably works fine.

 

Now, if you are initiating the script via an action so that you can access it via a hotkey I recommend trying BetterTouchTool (Mac) or AutoHotkey (Windows) to fire the script via a keyboard shortcut.

1 reply

jduncan
Community Expert
jduncanCommunity ExpertCorrect answer
Community Expert
January 26, 2023

Yeah, this gets asked about once a week on here. Basically, Ai ExtendScript is single threaded so when you initiate a script from within an action (first thread) and that script tries to run another action (second thread) Ai hangs since it's waiting for the first action to end. If you try just running the script from File > Scripts it probably works fine.

 

Now, if you are initiating the script via an action so that you can access it via a hotkey I recommend trying BetterTouchTool (Mac) or AutoHotkey (Windows) to fire the script via a keyboard shortcut.

Inspiring
January 26, 2023

My bad! I really did not know that this could happen once in a while, that's exactly what I am trying to do (well I did not know either that this question is often , my apologies but now I know what's happening)