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

Access a Layer inside a Group

New Here ,
Jun 06, 2017 Jun 06, 2017

Copy link to clipboard

Copied

So I have something like this:

var myDocument = app.activeDocument;

var theLayerA = myDocument.artLayers.getByName("A");

All I want is access to a layer named "A" in the active document, it works fine if that layer "A" is not in a Group. But if it's in a Group, I'll get the message "no such element".

I searched around this forum, someone showed a way to access a certain Layer inside a certain Group, but with that method I need to know the name of that Group. The thing is, I'm using this scripts for diffrent psd files, and in each psd files, layer "A" stays in diffrent groups ( or not in a group at all ).

Is there a way to find layer A no matter what group it is in ?

I'm sorry for my English, please forgive me if my way of asking is impolite.

Thank you very much.

TOPICS
Actions and scripting

Views

211

Translate

Translate

Report

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
Adobe
Community Expert ,
Jun 06, 2017 Jun 06, 2017

Copy link to clipboard

Copied

LATEST

Votes

Translate

Translate

Report

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