Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hi David,
On Win, you'd run this from the command line:
afterfx.exe -noui -r c:\myDocuments\Scripts\yourAEScriptHere.jsx
Copy link to clipboard
Copied
And you can even specify the file of the project (composition = *.aep)?
Copy link to clipboard
Copied
Zac,
Where are the switches documented for the afterfx.exe program? So far, I know -s -r -m and now I've learned -noui. Are there any more? If so, where can I find them?
Thanks!
Copy link to clipboard
Copied
Are the switches to afterfx.exe documented anywhere?
Copy link to clipboard
Copied
Hi Lazlo,
The other one is -wf for Watch Folder mode, documented here: http://help.adobe.com/en_US/aftereffects/cs/using/WS3878526689cb91655866c1103a4f2dff7-79a2a.html#WS6...
Message was edited by: Zac Lam
Copy link to clipboard
Copied
Hi Zac, Lazlo is there anywhere I can read about these flags... and reasons to use afterfx.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
afterfx.exe
-m ?
-n ?
-s [send text string to execute as script]
-r [read a .jsx file and execute]
-wf [watch folder]
Copy link to clipboard
Copied
Using AfterFX.com instead of AfterFX.exe allows you to get return codes on the command line for errors. I don't remember now if they are useful beyond "oh, yep, there was an error" but you don't get anything from the exe.
-m starts a new instance of After Effects even if one is already running.
I have a shell/batch script that does the script generation in my %TEMP% directory, if you're going to be doing a lot of automated stuff you may want to use app.beginSuppressDialogs() and app.endSuppressDialogs() judiciously. In my case I basically spit out a jsx that has a function in it that then gets called once per file in the directory; the function itself is fixed but I just write it out so I don't need to import anything.
Going down this route though, After Effects is really bad about memory. You can tell it to clean itself up and that helps but if you're processing a lot of AEP files during one run of After Effects you're going to run out of memory. I can usually get 10-15 app.open(new File(filename)) calls before crashing, so that's another thing you have to keep in mind.
Copy link to clipboard
Copied
I have a file named After-Effects-CS6-Scripting-Guide.pdf. I have no recollection about where it came from. It documents the scripting interface to After Effects, though.
Also, look at installing the ExtendScript SDK. It has a somewhat useful debugger and object inspector for scripting Adobe products, including After Effects.
Insofar as what you want to do there are three ways that I can think to do it.
Write a plugin using the ExtendScript SDK and pass a short stub script to After Effects on the command line:
afterfx.com -noui -m -s "var lib=new ExternalObject('lib:YourPlugin.aex');lib.YourFunction('param1', 'param2', etc);app.quit();"
Generate your script with the filenames already baked into it; this should be straight forward but it's annoying since you get all of these scripts lying around...
afterfx.com -noui -m -r my_generated_script.jsx
Figure out how to write the script once then import it and call functions on it from the command line:
afterfx.com -noui -m -s "import_or_something myScript;myFunction('param1', 'param2', etc);app.quit();"
I don't know if this last one is possible, thankfully I haven't had cause to try it yet since my first foray into this stuff was pretty heavily based on plugin interaction, I took route #1 at first. Now I have a couple of things that pretty mechanically do #2 and there's not enough boilerplate to try to figure out #3.
Copy link to clipboard
Copied
The AE scripting guide can be downloaded here: After Effects Developer Center | Adobe Developer Connection