I'm trying to build a proof of concept macOS application to render an Adobe After Effects project file by executing aerender
command line tool via NSTask/Process but not having much success.
var task: Process = Process()
func render()
let compPath = "/Users/Admin/Documents/test-proj.aep"
task.launchPath = "/Applications/Adobe After Effects CC 2019/aerender"
task.arguments = ["-project", compPath,
"-comp", "output"]
do {
try task.run()
} catch let error {
print(error)
}
}
The above code successfully launches After Effects in the background but logs produce the following output:
aerender version 16.1.1x4
PROGRESS: Launching After Effects...
aerender ERROR -1701: AEGetParamPt failed at line 780
I've also attempted putting the commands into a separate Shell script and execute that from the application instead but that also produces the same results.
I can successfully run the same commands directly in Terminal using bash
and zsh
and get videos rendering perfectly. So I'm thinking this is an error with NSTask/Process rather than aerender
.
The application has:
- Application sandbox turned off
- Full disk access permissions to read and write.
I'm open to all ideas and answers in Obj-C or Swift at this point!