You don't need a script for this. You can do this with Post-Render Actions in the Render Queue:
Basics of rendering and exporting in After Effects CC
To specifically do what you're asking, to render an image sequence and then have that automatically sequence transcoded to a QuickTime file:
- Nest your original comp, Comp A into a new comp, Comp B. Make sure Comp B's frame dimensions, frame rate, and duration match Comp A. *** (There is an alternative method that may work better than nesting for some cases, see below.)
- Add Comp A to the Render Queue, set the Output Module to render to your chosen image sequence format. (TIFF, PSD, JPEG, etc.)
- In the Output Module settings, set Post-Render Action to Import & Replace Usage.
- Add Comp B to the Render Queue, set the Output Module to render your chosen movie file format. (QuickTime, etc.)
- Start the Render Queue.
*** The downside of nesting your comp for these steps is that if Comp A is already in use by other comps, this method will globally replace all instances of it. You may not want that. To work around this, create a placeholder (File > Import > Placeholder; make sure it's the same dimensions, frame rate, and duration as Comp A), and put that in it's own comp (again, make sure the dimensions, frame rate, and duration are the same). This time, for step 3, instead of opening the Output Module Settings dialog to set the Post-Render Action, twirl open the Output Module settings in the Render Queue; here you'll see the Import & Replace Usage option with a little pickwhip - use the pickwhip to choose the placeholder.
Other things to note about using Post-Render Actions to automatically transcode one output to another:
- There was a bug in After Effects 13.5 though 14.1 where post-render actions did not evaluate until the entire render queue had completed, which breaks this workflow. That bug is fixed in After Effects 14.2 (the recent April 2017 release).
- This works with multi-machine rendering, though only one machine can write the QuickTime file. (It sounds like you're already aware of this.)
- You can also use Adobe Media Encoder to do the transcode work, but using a Watch Folder. This even works with image sequences, though if your frames take a long time to render you will want to adjust the value in AME's Preferences > General, so that it waits longer before assuming the render is complete. The default is only 0.2 minutes.