Script opens in editor instead of running?
  • Brand new user, and I'm trying to run my first script. It's JavaScript that's supposed to execute in Illustrator, but when I try to run the script via FastScripts it opens the script in my script editor (TextWrangler) instead of executing the script.

    The script shouldn't be broken, because when I try to run it through the Illustrator menu it works perfectly.

    FastScripts is "scripting language agnostic", but I can't find anything confirming nor denying that it works with JavaScript. Is JavaScript the issue?

    Additional details: I'm on Mac OS 10.9.1, Illustrator CS6.

    Thanks in advance!
  • Daniel JalkutDaniel Jalkut
    Accepted Answer
    Hi there - FastScripts will run a variety of scripting languages, but only if the scripts are either AppleScript or will run as standalone scripts on the command line (e.g. a scripting language like perl, python, sh, bash, etc that can be invoked from the command line). Unfortunately for this kind of JavaScript-based script that is especially suited to Illustrator, it might not fit the bill.

    Since FastScripts is running the script outside of the targeted app, it has to be able to make sense of the script independently of the app.

    That said, I wouldn't be surprised if the JavaScript code could be packed up into an AppleScript that asks Illustrator to run the JavaScript. Do you have any experience with writing AppleScripts for Illustrator? I am wondering if it supports an AppleScript command like "do javascript" that would be useful for running arbitrary scripts from outside the app.
  • Hi Daniel,

    That confirms my suspicions. Thank you for the clear explanation!

    I have a novice-level understanding of AppleScript, and I do believe there is a way to trigger a JavaScript via AppleScript. I'll do some digging around and see what I can find.

    Thanks again!
  • Great - let us know if you find a solution, or if there's anything else I can do to help.
Start a New Discussion

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!