Quantcast
Channel: Adobe Community: Message List - Photoshop Scripting
Viewing all articles
Browse latest Browse all 27456

How to set a group's children to visible with ActionManager?

$
0
0

Hi, so i need to set all the children of a group to visible (both layers an groups). I wrote this recursive function:

 

function setChildrenToVisible(group){  var numberOfChildren = group.layers.length;  for (var i = 0; i < numberOfChildren; i++){    group.layers[i].visible = true;    if (checkIfLayerSet(group.layers[i])){      setChildrenToVisible(group.layers[i]);    }  }


}


function checkIfLayerSet(layerToCheck){
    if (layerToCheck.typename == "LayerSet"){        return true;    }    else {        return false;    }
}

 

It works, however I'm dealing with a lot of inner layers and it just takes too long with this approach. In the past using the Action Manager instead of the DOM made a significant change in performance. Is there a way to set all of the children of a given group to visible with the ActionManager rather than trying to access the DOM?

 

Thank you


Viewing all articles
Browse latest Browse all 27456

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>