-
Extendscript – get name of comp which a layer is in?
Hey guys,
Im trying to build something here, but im running into some issues.
Im doing all kinds of for loops to find layers in my project – in the entire project. The layers I want to find are color coded, or locked, or shy for example.
If one of those layers is found, i would like to get the name of the composition that layer was found in. Preferrably the sourcename of that comp, but a name would be a great starting point.Now most of the scripting goes from toplever down to layer level – like project, comp, layer – but in this case i would like to do it inside out, from layer, to comp, etc.
Does anyone know a way to find the compname in which a layer is present through extendscript?
Any help is much appreciated!
Thanks!
//this looks for darkgreen labeled layers - but now i need the compnames of the comps that have those layers in them
function greenCheckFunction() {for (var h = 1; h <= app.project.numItems; h++)
if (app.project.item(h) instanceof CompItem)
for (var i = app.project.item(h).numLayers; i > 0; i--) {
if (app.project.item(h).layer(i).label == 16) {
exclusionArray.push(app.project.item(h).layer(i).name)
}
}
}