Merge Layers within LayerSet
Hey Peoples!
I'm trying to make a script that will merge all the layers within a Layer Set and then rename the resultant flattened layer after the Layer Set itself. So far I've gotten to this point with my code, but I'm pretty new to all this sort of stuff, so please try not to laugh. haha ![]()
var myLayerSet = app.activeDocument.activeLayer;
var mergeLayerName = myLayerSet.name;
myLayerSet.layers.merge();
myLayerSet.layers[0].name = mergeLayerName;
I think the problem I'm having is that I don't know how to go about selecting all the layers within the group itself. I can get it to the point where it will merge the whole group to a layer and rename that, but that won't work for the application I'm trying to accommodate.
Any help with this would be greatly appreciated.
Thanks! ![]()