Run .jsx File From Command Line Windows

Contributor ,
Sep 04, 2018 Sep 04, 2018

Copy link to clipboard

Copied

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?

TOPICS
Scripting

Views

5.1K

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 06, 2018 Sep 06, 2018

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 08, 2018 Sep 08, 2018

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 08, 2018 Sep 08, 2018

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 03, 2020 Mar 03, 2020

Copy link to clipboard

Copied

LATEST

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines