Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Finding the parent of a clipped layer

Advocate ,
Jul 16, 2017 Jul 16, 2017

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.

DB 2017-07-16 alle 15.22.22.png

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

http://htmlpanelsbook.com

TOPICS
Actions and scripting
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 16, 2017 Jul 16, 2017

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

...
Translate
Adobe
Community Expert ,
Jul 16, 2017 Jul 16, 2017

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jul 17, 2017 Jul 17, 2017

That is neat indeed: charIDToTypeID('Bckw')

Thank you sir 🙂 very much appreciated, one always learns in this place!

Davide

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 17, 2017 Jul 17, 2017
LATEST

You're welcome.

Perhaps this helps you in the future too

var idFrwr = charIDToTypeID( "Frwr" );

Have fun

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines