7

I created a extendscript that automatically creates layersets for asset textures for a game.

After creating a layerset, the set is expanded by default. I want the layerset to be collapsed as shown in the picture below. I leave only the Diffuse layer to be expanded. The rest is closed. I've searched the reference by Adobe on how to do this but couldn't find anything. How do i collapse a layerset?

The layersets as it should be: only Diffuse should be expanded

SuperBiasedMan
  • 9,814
  • 10
  • 45
  • 73
Nique
  • 543
  • 7
  • 21
  • Try the graphic design site ( http://graphicdesign.stackexchange.com/ ). – Michal M Sep 12 '15 at 14:40
  • 1
    I'm doing this through scripting. :) – Nique Sep 12 '15 at 14:48
  • I have never worked with extend script but I would think there is some event you can trigger in order to collapse/expand the layer set. I think Adobe support might be best to contact. – Aaron Jun 16 '16 at 19:58

2 Answers2

2

As Mr Mystery Guest said, unfortunately you can't collapse a particular group, but you can collapse all the groups.

The link from the accepted answer is dead, so I will post here a solution:

var idcollapseAllGroupsEvent = stringIDToTypeID("collapseAllGroupsEvent");
var desc = new ActionDescriptor();
executeAction(idcollapseAllGroupsEvent, desc, DialogModes.NO);
Vlad Moyseenko
  • 203
  • 4
  • 7
1

There is no way to do this via scripting (I've looked into this before). There simply is no collapse (or equivalent) layerSets property to set!

However, what you can do is press CTRL (or Command on Mac) and click on the little arrow next to the group (in the layers window) - which will collapse all the groups for you.

There is a work around solution : but you'll have to search for it

Mr Mystery Guest
  • 1,464
  • 1
  • 18
  • 47