1 Reply Latest reply on Apr 8, 2008 11:45 PM by Mylenium

    AfterFX OSX AppleScript Javascript jsx command line call.

      I'm having a problem getting AfterFX on OSX to run a javascript file from an applescript.
      On windows i can just call aerender with the -m -r file.jsx flags.
      On OSX i'm supposed to use an applescript.
      I can get this to work fine:

      tell application "Adobe After Effects CS3"
      DoScript "alert(\"You just sent an alert to After Effects\")"
      end tell

      I cannot get a script like this to work:

      tell application "Adobe After Effects CS3"
      DoScriptFile "/var/tmp/AfterFx123.jsx"
      end tell

      i tried the simplest .jsx file I could, namely:

      alert("hi");

      It does not work.

      I get an error from AfterFX:

      Unable to execute script at line 1. Expected: ;

      As you can see, there is a semicolon in the script.

      Anyone able to get command line running of a javascript AfterFX file working on OSX or have any advice?

      Thanks!
        • 1. Re: AfterFX OSX AppleScript Javascript jsx command line call.
          Mylenium Most Valuable Participant
          This is a known issue. You need to escape the script names before calling them and you may also need to double-escape any strings in the files, otherwise AppleScript will interpret them as own code, truncate them and thus they won't run. It should more look like this, I believe:

          tell application "Adobe After Effects CS3"
          DoScriptFile \"/var/tmp/AfterFx123.jsx\"
          end tell

          If you search the archives here or look at AEnhancers, you will certainly find the appropriate threads. I definitely remember having seen such discussions in the past.

          Mylenium