Copy link to clipboard
Copied
I wrote a small script that should display the number of objects inside the group and the name of the groups (only the first nesting level), but the script loops endlessly, who has already encountered this, can you tell me what the problem is?
#target photoshop
var docRef = app.activeDocument;
var myGroups = docRef.layerSets;
alert(myGroups.length);
for( i = 0; i < myGroups.length ; i++) {
try{
alert(myGroups[i].name);
alert(myGroups[i].layers.length);
}catch(e){}
};
Copy link to clipboard
Copied
I don't see any problem in this code ¯ \ _ (ツ) _ / ¯
Have you tried it on different documents with different number of groups and always observed this behavior?
Copy link to clipboard
Copied
What does endlessly mean? What do the alerts show and how do you run the script? Is this the complete code?