Page 1 of 1

Making a layer group active

Posted: Fri Jul 26, 2019 12:05 am
by Limey
I am trying to make layer groups active in order to rename them. I can do it to a layer outside of a group but not to the group itself. It was my understanding that groups were treated the same as the art layers.

Why does the below code only work on art layers and not on layer sets?

Code: Select all

var doc = app.activeDocument;
doc.activeLayer = doc.artLayers.getByName("test");
app.activeDocument.activeLayer.name = "Hi there!"
Thanks,
Limey (Paul)

Re: Making a layer group active

Posted: Wed Jul 31, 2019 1:22 am
by Kukurykus
Change 'artLayers' to 'layers' or if you have artLayers and groups with the same name then to 'layerSets'.

Re: Making a layer group active

Posted: Thu Aug 22, 2019 7:21 am
by Limey
Thank you kukurykus! Your answer was just what I needed.

Limey