-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmultipleLayers.jsx
More file actions
33 lines (23 loc) · 980 Bytes
/
Copy pathmultipleLayers.jsx
File metadata and controls
33 lines (23 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Scann all properties of selected layers and count them
$.evalFile(File("../src/PropertyTreeLooper.jsx").fsName); // include the PropertyTreeLooper class
(function () {
var comp = app.project ? app.project.activeItem : null;
if (!(comp instanceof CompItem)) {
alert("Please select a composition first.");
return;
}
var selectedLayers = comp.selectedLayers;
if (!selectedLayers || selectedLayers.length === 0) {
alert("Please select some layers first.");
return;
}
var numPropertiesAcrossSelectedLayers = 0;
var looper = new PropertyTreeLooper(); // create a new instance of the PropertyTreeLooper class
looper.onPropertyFound = function (prop) {
numPropertiesAcrossSelectedLayers++;
};
for (var i = 0; i < selectedLayers.length; i++) {
looper.loop(selectedLayers[i]);
}
alert("Number of properties across selected layers: " + numPropertiesAcrossSelectedLayers);
})();