We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.
I've reviewed numerous solutions and none of them work. I need to execute a script in After Effects by launching through python. I've found the generic solution:
"C:/Program Files/Adobe.../AfterFx.exe" -r "Path/to/my/script/myScript.js";
If I paste this into the windows command prompt, the first part opens/runs afterfx just fine, but it doesn't run the script. If I run the script from within AFX (File:Scripts:Run Script File) it executes correctly. Every variation I've found of this generic solution doesn't work either.
Ultimately I need to run this from python:
this_aep = 'X:/path/targetAfterfxFile.aep'
cmd = '"C:/Program Files/Adobe.../AfterFx.exe" -r "Path/to/my/script/myScript.js";'
Please help. I'm not a java person or a windows programmer. How can i get AFX to run the damn script automatically? It needs to run on a loaded aep file, so running it on startup won't work and I don't want to to run every time AFX opens.
What are the contents of the script? When you run it outside of AE, does any line execute? Are you logging anything from the script to an external file?
If the script works when running within AE, but then doesn't work running it from the command line, the script is probably doing something that requires AE to be running.
The script saves as a new file, replaces some footage, renames some text, and renders to a directory provided by a json generated by maya. Everything inside the script executes like it's supposed to if i run from within AfterFX or ctrl+R from visual studio. I need to be able to execute it through python as part of an automated process. If I try to execute through the command line, if AE isn't open it will open it, but it does nothing else, like it's not reading the script at all.
Yes, AE needs to be running and that's not the problem. I have a python command that opens the correct file in After effects (it's just a system call to the file) and then I need to have AE execute the script with that file open.
anyone? please help.
Running an AE script from the command line will open a separate copy of After Effects. It won't run the script in the copy of After Effects that is already open.
Rather, you need a script that opens the AE project and runs what you need to do all in one go.
Great. How do i do that?