Copy link to clipboard
Copied
Hi,
I was wondering if some of you has already come up with a way to find the reference to the "parent" of a clipped layer.
E.g.
In this case, the input is the current layer (Levels), which is clipped (alongside with Curves) to the Dup layer.
I'm interested in getting the "Dup" (as the parent, so to speak), starting from the "Levels" (the child clipped).
Thanks,
Davide
Hi DBarranca​,
do you mean something like this
...var aDoc = activeDocument;
var aLay = aDoc.activeLayer;
while (aLay.grouped == true) { // Be careful with while loops
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Bckw') );
desc1.putReference( charIDToTypeID('null'), ref1 );
executeAction( charIDToTypeID('slct'), desc1, DialogModes.NO );
aLay = aDoc.activeLayer;
}
alert("paren
Copy link to clipboard
Copied
Hi DBarranca​,
do you mean something like this
var aDoc = activeDocument;
var aLay = aDoc.activeLayer;
while (aLay.grouped == true) { // Be careful with while loops
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Bckw') );
desc1.putReference( charIDToTypeID('null'), ref1 );
executeAction( charIDToTypeID('slct'), desc1, DialogModes.NO );
aLay = aDoc.activeLayer;
}
alert("parent: " + aLay.name);
Have fun
Copy link to clipboard
Copied
That is neat indeed: charIDToTypeID('Bckw')
Thank you sir 🙂 very much appreciated, one always learns in this place!
Davide
Copy link to clipboard
Copied
You're welcome.
Perhaps this helps you in the future too
var idFrwr = charIDToTypeID( "Frwr" );
Have fun