skip to Main Content

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

2

Answers


  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

    Login or Signup to reply.
  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);
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search