user16898: 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);
}


user16898: 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;
        } 
    }
} 


16898: <p>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. </p>

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

<pre class="lang-js prettyprint-override"><code>app.beginSuppressDialogs();
{
    var projectFile File("C:\\AfterFX\\MyProject.aep");
    app.open(projectFile);
    MyCustomDataExchangeFunction();
    app.executeCommand(3800);
}
</code></pre>
 16898: <p>I found the right property that has to be changed and wrote a function that does the job:</p>

<pre class="lang-js prettyprint-override"><code>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;
        } 
    }
} 
</code></pre>
