How do I loop through all compositions in an After Effects project?
Asked Answered
M

1

5

How does one loop through all the compositions in the currently opened After Effects project?

Megrims answered 11/2, 2014 at 0:35 Comment(0)
M
8

The app.project.items holds all the compositions, and folders in the currently opened project. So this way I can loop through all of these, and I also have to check for whether it is a composition (since it can be a folder as well).

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.
    }
}
Megrims answered 11/2, 2014 at 0:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.