ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Run JSX without AfterFX.com ?

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Russ Andersson
Run JSX without AfterFX.com ?
on Nov 8, 2013 at 4:23:23 pm

Anyone now how to force After Effects to run a javascript WITHOUT going through AfterFX.com ?

The nominal way to run javascripts is

afterfx -r scriptname.jsx

which starts not afterfx.exe but afterfx.com !

Afterfx.com is old tech that throws up an ugly DOS console window, I don't want to do that.

So I'm looking for an undocumented way to tell afterfx.exe to run a script :-)


Return to posts index

Walter Soyka
Re: Run JSX without AfterFX.com ?
on Nov 11, 2013 at 8:02:27 am

[Russ Andersson] "The nominal way to run javascripts is afterfx -r scriptname.jsx"

[Russ Andersson] "Afterfx.com is old tech that throws up an ugly DOS console window, I don't want to do that."

Even though it has a .COM extension, it's not an old-school .COM file. It as the MZ header that .EXEs have. On Windows, the PATHEXT environment variable tells the system what order to run executables when no extension is given if there are more than one with the same name; COM takes precedence by default.

So I don't think it's "old tech" -- rather, I think it's the way to interface with Ae via the command line.

In what context are you launching the script? It might be possible to suppress the command line window.

Walter Soyka
Principal & Designer at Keen Live
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
RenderBreak Blog - What I'm thinking when my workstation's thinking
Creative Cow Forum Host: Live & Stage Events


Return to posts index

Russ Andersson
Re: Run JSX without AfterFX.com ?
on Nov 11, 2013 at 5:14:14 pm

I'm launching it from a GUI executable. The .com is a command-line program, you can double-click it and you get the console window no matter what.

After some teeth-gnashing, I did determine that afterfx.exe also processes the -r option, allowing one to launch scripts from the other programs without opening a console window.

There is a big gotcha, though, which has likely thrown off other people on the net who have tried to do this.... AfterFX.exe does not perform any quote processing --- you must NOT put any quotes around the full path name of the AfterFX executable, and you must NOT put any quote around the full path name of the script to be run. You must do this:

C:program filesadobeadobe after effects ccsupport filesafterfx.exe -r d:my longpath nameand script.jsx


By contrast, AfterFX.com is fine with the usual quoting you'd put around the executable name and script name.

You can easily verify this for the script name from a console window; it applies for exe too though its a little harder to verify. Hopefully this will save someone some hair.



Return to posts index


Walter Soyka
Re: Run JSX without AfterFX.com ?
on Nov 11, 2013 at 5:48:35 pm

[Russ Andersson] "There is a big gotcha, though, which has likely thrown off other people on the net who have tried to do this.... AfterFX.exe does not perform any quote processing --- you must NOT put any quotes around the full path name of the AfterFX executable, and you must NOT put any quote around the full path name of the script to be run."

That's a fantastic find. Thanks for sharing.

Walter Soyka
Principal & Designer at Keen Live
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
RenderBreak Blog - What I'm thinking when my workstation's thinking
Creative Cow Forum Host: Live & Stage Events


Return to posts index

Shadab Rashid
Re: Run JSX without AfterFX.com ?
on Apr 11, 2014 at 4:43:28 pm

Hi,

Thank you for sharing this "gotcha". Just to add that:
The path for the executable itself, Windows Command Prompt does force me to put the entire path in double quotes. Otherwise, it won't run. If I pass the full path of the JavaScript file argument within double quotes, as you mentioned, doesn't process the file. But it doesn't show any error messages on the Windows Command Prompt.

For exmaple, if running from the same directory as the AfterFx.exe:

C:\>Program Files\Adobe\Adobe After Effects CC\Support Files\AfterFX.exe -r C:\testJavaScript.jsx // <-- this works
------------

C:\>"\Program Files\Adobe\Adobe After Effects CC\Support Files\AfterFX.exe" -r C:\palette_dialog.jsx // <-- this works too. And the path/executable NEEDS to be in quotes
--------


Cheers.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]