Copy link to clipboard
Copied
Or a script if someone has that i can bind to a button.
// Collapse all layer groups/sets
app.runMenuItem(stringIDToTypeID('collapseAllGroupsEvent'));
Copy link to clipboard
Copied
Have you tried cmd-clicking the »open triengle«-icon that indicates this?
Copy link to clipboard
Copied
>> shortcut <<
Copy link to clipboard
Copied
I apologize, I had read sloppily.
Copy link to clipboard
Copied
// Collapse all layer groups/sets
app.runMenuItem(stringIDToTypeID('collapseAllGroupsEvent'));
Copy link to clipboard
Copied
For completeness, I wanted to add the following code, however it no longer appears to work?
// Expand all layer sets
// https://forums.adobe.com/message/5764024#5764024
function openAllLayerSets(parent) {
for (var setIndex = 0; setIndex < parent.layerSets.length; setIndex++) {
app.activeDocument.activeLayer = parent.layerSets[setIndex].layers[0];
openAllLayerSets(parent.layerSets[setIndex]);
}
}
openAllLayerSets(app.activeDocument);
Copy link to clipboard
Copied
It's supposed to recursively expand set by setting it as active layer?
I just recently started looking into PS scripting, so i don't know api at all.
Copy link to clipboard
Copied
Where did you get
collapseAllGroupsEvent
from? Is there a doc with all those events?
Copy link to clipboard
Copied
Script listener output from action panel insert menu item command or from simply using the menu command.
https://blogs.adobe.com/crawlspace/2006/05/installing_and_1.html
Scripting Listener not working in Photoshop 2020 for mac
Copy link to clipboard
Copied
The Group-opening code works fine for me (on 21.1.2).
Copy link to clipboard
Copied
>however it no longer appears to work?
shouldn't have trusted you!
Works indeed, but slow.
Wondering if there is an event for that.
Copy link to clipboard
Copied
GIGO, I quickly tested with multiple empty sets, I'm sure it will work when I actually put something inside!
Copy link to clipboard
Copied