recursiveLayerUnlock(activeDocument)function recursiveLayerUnlock(l){ for (var i = 0; i < l.layers.length; i++){ l.layers[i].locked = false; if (hasSubLayer(l)) { recursiveLayerUnlock(l.layers[i]) } }}function hasSubLayer(l){ return l.layers.length > 0}