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) {
}
}
source
share