1 Reply Latest reply: Oct 20, 2009 4:20 PM by mwdiers RSS

    CS4 do javascript from AppleScript

    cweger79 Community Member
      Hi all,
      Consider this AppleScript snippet:

      tell application "Adobe Illustrator"
      do javascript myFile with arguments {"one", "two"}
      end tell

      The file "myFile" is executed OK, but how does myFile (a JavaScript script) get the arguments passed in from AppleScript? I don't see this documented anywhere.

      Thanks,
      Chuck
        • 1. Re: CS4 do javascript from AppleScript
          mwdiers Community Member

          Since nobody answered this:

           

          In your Javascript, you will find an arguments array containing the arguments you passed from Applescript or VBscript

           

          So, using your example, if you added this line to your JSX file:

           

          alert(arguments[0]);

           

          You would get an alert saying "one" when you ran your Applescript.