Skip to main content
johnt53984649
Inspiring
September 5, 2018
Question

Run .jsx File From Command Line Windows

  • September 5, 2018
  • 2 replies
  • 10180 views

Suppose I have an adobe after effects project open.  Is it possible to use the command line on Windows to run a .jsx script that will execute for the currently open instance of after effects?

I know this might seem like a strange request, but I'm trying to interface python code with after effects scripting, and if I can somehow get .jsx script code to execute automatically after a Python script finishes, that would be fantastic.

If I can run the .jsx script from command line, then I could just have Python make a system call to that file.  But opening a .jsx script with ExtendScript just brings it into the editor and does not execute it on Windows.

So perhaps associating the .jsx extension with a different .exe file could do it, but I'm not certain.

If it's not possible, then how can I write an After Effects script that runs the Python code and doesn't continue executing until the Python script is completely finished?

2 replies

Andrei Popa
Inspiring
September 8, 2018

I think the command for windows would be "C:\Program Files\Adobe\Adobe After Effects CC 2018\Support Files\afterfx.exe" -r  "script/path/here.jsx".

You may need to modify the first path based on the version and installation path of your after effects.

johnt53984649
Inspiring
September 8, 2018

andreip14565073​, you are correct, except there should NOT be quotes around the path to the script, even if there is a space in the path to the script.  Interesting, but that's how it works.  Thank you!

Actually, you were correct, if running directly in cmd.  I was running it from a Python "os.system()" call, in which case there shouldn't be those second quotes as I mentioned... I'm not sure what causes that difference.

Participant
March 3, 2020

So helpful, thank you: worked like a charm without the quotes.

charlesbevan
Inspiring
September 6, 2018