2

I am rendering a project several times, and use a script to change some of the input. However, I have not figured out how to change the name of the output file in the script.

This is basically my script. I left the details of my modifying function out as they are irrelevant.

app.beginSuppressDialogs();
{
    var projectFile File("C:\\AfterFX\\MyProject.aep");
    app.open(projectFile);
    MyCustomDataExchangeFunction();
    app.executeCommand(3800);
}
1
  • In case anybody is wondering, app.executeCommand(3800) sends the composition to the Adobe media encoder.
    – EluciusFTW
    Oct 11 '16 at 7:52
2

I found the right property that has to be changed and wrote a function that does the job:

function renameComposition(newName) {
    var curComp = null;
    for (var i = 1; i < app.project.numItems +1; i++) {
        if(app.project.item(i) instanceof CompItem) {
            curComp = app.project.item(i);
            curComp.name = newName;
        } 
    }
} 
1
  • Beware, though, that this changes teh names of every composition in your project to newName. That does not matter in my case, just fyi.
    – EluciusFTW
    Jan 18 '17 at 10:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.