launchd process using aerender exits early
(Edited/Updated)

According to this thread on StudioSysAdmins, the problem I'm running into is because of aerender's reliance upon the Window Manager.


  Aerender is a hack that wraps the entirely GUI based After Effects
  application with a basic command line render interface. The AE core
  itself still depends directly on the Window Manager.
  ...


-Robin Scher

I ended up getting around this by using AppleScript (osascript) in the property list like so:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    ...
    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
      &lt;string&gt;/usr/bin/osascript&lt;/string&gt;
      &lt;string&gt;/absolute/path/to/run.applescript&lt;/string&gt;
    &lt;/array&gt;
    &lt;key&gt;KeepAlive&lt;/key&gt;
    &lt;false/&gt;
&lt;/dict&gt;
&lt;/plist&gt;


Here is what run.applescript looks like:

tell app "/Applications/Utilities/Terminal.app"
  set w to do script "/Users/home/Developer/VideoGenerator/exec/render.sh; exit 0"
  repeat
    delay 1
    if busy of w is false then exit repeat
  end repeat
  #display dialog "finished"
end tell


I tell launchd to use osascript to run aerender in the context of a Terminal window.  A little convoluted, but it works!