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
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.
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)
Another question, sorry, so AutoHotkey (Windows) will alow me to trigger the script just like if I run it via: File > Scripts?
thank you so much!
Hi ! Been a while! I am trying to make the script work with BetterTouchTool , but once I trigger with my key combination Mac shows a message telling me to choose an app to open that file, how can you open scripts in illustration using BetterTouchTool ? Does the script need to be written in AppleScript? Thanks!
Here's how I have it set up. "AiCommandPalette" is the name of the script it runs. The script needs to be in the Ai scripts folder too.
Nice! I wasn't aware of this option. 👍
I probably should have mentioned earlier that I actually use Keyboard Maestro to do this on my personal machine (even though I mentioned Better Touch Tool before). Keyboard Maestro is a swiss army knife for Mac automation but it isn't cheap. Just wanted to be transparent. Cheers!
Does the same limitation apply if you run the script that calls an action from an extension? Was thinking of going that path to group the scripts I have, rather than running them from actions first.
No, I don't think so as quite a few extensions allow you to load and run scripts.