Change Output file name in AfterFX .jsx script 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);
}
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 &lt; app.project.numItems +1; i++) {
        if(app.project.item(i) instanceof CompItem) {
            curComp = app.project.item(i);
            curComp.name = newName;
        } 
    }
}