Skip to main content
Inspiring
October 15, 2013
Question

Expand/Contract Layer Groups

  • October 15, 2013
  • 2 replies
  • 7716 views

So I spent the evening researching a way to expand/contract a layer group.. normally we have to click on the small triangle icon that appears before the layer name in the layers panel to expand the group, and click it again to fold it all up. So far, I've found information stating that it can't be done via scripting...

I thought up one way to do it, and that would be to search a layer by name (using a different script), and make sure that the layer name being searched for is inside of a contracted group.. and when that layer name is found and selected, it will unfold the layer group and show select the layer. It's quite a runaround though. Is there a more efficient way to do it with a script?

This topic has been closed for replies.

2 replies

Stephen Marsh
Community Expert
Community Expert
May 18, 2023
c.pfaffenbichler
Community Expert
Community Expert
October 16, 2013
Inspiring
October 16, 2013

Thanks, had a look through the topic (I had actualy browsed through one of those links a few months back) and it seems that there's no way to do it via a script. Tried all the sample code there and none of it was able to pull it off... seems the only way to do it is to activate a layer within the layer group and then it will unfold it.

Just gotta make sure one of the layer names within the group is always the same (create an empty layer and name it "unfold" for example) and then use a script which activates the layer "unfold" and then it will expand that group.. but what if several layer groups all contain "unfold".. it might not know which layer group to go to (or it will go to the first one)

It's quite a workaround but it would likely do the trick...

Inspiring
October 22, 2013

cbuliarca wrote:

The problem is that the entire line is a string...

Couldn't you set the font for that control to use a mono spaced font?


Hi Michael,

I never knew about the mono spaced fonts, I did a search and seen what's about, and seams to me that this kind of font could solve my problems. I will give it a try.

Thank you very much for your suggestion