Acessing Layer within a group

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

rasoetan

Acessing Layer within a group

Post by rasoetan »

How can I access a layer by name if that layer is within a group? I am able to access the layer when it is at the top level.

Thanks,
Raphael

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

Mike Hale

Acessing Layer within a group

Post by Mike Hale »

If you know the name of the group you can do something like this
Code: Select allapp.activeDocument.layerSets.getByName('groupName').artLayers.getByName('layerName')
or you can work by index. For example to get a layer by name in the top most group
Code: Select allapp.activeDocument.layerSets[0].artLayers.getByName('layerName')
rasoetan

Acessing Layer within a group

Post by rasoetan »

Thanks!