Change Output file name in AfterFX .jsx script
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;
        } 
    }
}