Skip to main content
Inspiring
March 25, 2009
Question

Run a script from Make, headless.

  • March 25, 2009
  • 2 replies
  • 6240 views
This has come up for me a few times, and each time I found some other way around it. But I'm sure it's possible, I just havent found the incantation.

I want to run an AE script totally headless (no UI, no interaction).

The script might be something like, pseudo-code:

> open("my_project.aep");
> var data = readDataFile("./datafile.txt");
> setTextAndKeyFrames("comp1",data);
> renderMyMovie("comp1","./todaysHeadlines.mov");
> app.quit();

And I want to run it something like:

> afterEffects --script="./myScript.jsx"

I must be thick. But. What is the incantation for this?
This topic has been closed for replies.

2 replies

Inspiring
August 13, 2015

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.

stib
Inspiring
February 22, 2016

The AE scripting guide can be downloaded here: After Effects Developer Center | Adobe Developer Connection

Inspiring
April 8, 2009

Hi David,

On Win, you'd run this from the command line:

afterfx.exe -noui -r c:\myDocuments\Scripts\yourAEScriptHere.jsx

Inspiring
December 3, 2010

And you can even specify the file of the project (composition = *.aep)?