'Getting all open compositions in After Effects Extend Script
I want to write an After Effects script that process all currently open compositions.
I've found app.project.activeItem, but that gives me only the composition that's currently in the viewer, instead of all compositions that are open in the timeline.
I've also found app.project.items but that gives me all compositions (and other objects) and I can't find a way to check whether a composition in that list is actually open as a tab in the timeline.
Solution 1:[1]
function openComps() {
var comps = [];
do {
comps.unshift(app.project.activeItem);
app.executeCommand(app.findMenuCommandId("Close"));
} while (app.project.activeItem != null && app.project.activeItem instanceof CompItem);
for (var i = 0; i < comps.length; i++) {
comps[i].openInViewer();
}
return comps
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Lasha Brodzeli |
