How to scroll through all compositions in an After Effects project?

How do I loop all the songs in the current open After Effects project?

+3
source share
1 answer

app.project.itemscontains all the compositions and folders in the current open project. That way, I can go through all of these, and I also need to check if this is a composition (since it could be a folder).

for (var i = 1; i <= app.project.numItems; i++) {
    if (app.project.item(i) instanceof CompItem) {
        // Do stuff with the composition.
        // app.project.item(i) is the composition.
    }
}
+6
source

All Articles