Looping through Photoshop layers in Javascript
问题 I'm trying to write a Photoshop script that will show all layers of a given name. I need to loop through all the possible nested layer sets and am using the following code: function showBounds(layerNode) { for(var layer in layerNode.artLayers) { if (layer.name == "@bounds") { layer.visible = 1; } } showBounds(layerNode.layerSets); } showBounds(app.activeDocument.doc.layerSets); But when I run it, I get the following error: Error 1302: No such element Line: 5 -> for(var layer in layerNode