Skip to main content
Andreas Resch
Inspiring
December 4, 2022
Question

Select filtered layer in main layer tree

  • December 4, 2022
  • 2 replies
  • 3401 views

When I use the layer filter (that search bar at the top of the layer palette), select a layer there and then switch that filter OFF again, that layer is not selected/active in the main layer tree. Is there a way to make that happen?

This topic has been closed for replies.

2 replies

Stephen Marsh
Community Expert
Community Expert
December 5, 2022

For anybody interested in this feature, the idea/feature request post can be found in the following link for your vote:

 

https://community.adobe.com/t5/photoshop-ecosystem-ideas/updating-main-layer-tree-when-selecting-a-filtered-layer/idc-p/13395433

 

c.pfaffenbichler
Community Expert
Community Expert
December 4, 2022

Did you select the Layer (before desctivating the filtered display)? 

Could you please post screenshots with the pertinent Panels (Toolbar, Layers, Options Bar, …) visible? 

Andreas Resch
Inspiring
December 4, 2022

I've checked and again and the problem seems to be a bit different. The layer actually IS selected. But when they are in a closed group, you can't see that in the main tree. So I have to slightly alter my question ...

How is is possible, that the selected layer becomes VISIBLE in the main tree. So basically the parent group should be espanded and the layer should be visible. It's something similar to the Windows Explorer where a directory tree is expanded once you select a folder in the file window.

Stephen Marsh
Community Expert
Community Expert
December 4, 2022

Thinking out loud, this could be scripted.

 

Edit: I wanted to do this using the unique layer ID, however, it appears that the layer content filter messes this up?

 

So I had to resort to using the less-than-ideal layer/group name value (which only works consistently as expected if there are unique layer/group names). 

 

Script 1 of 2:

 

#target photoshop

// Script 1 of 2

try {
    if (activeDocument.activeLayer.parent.typename === "LayerSet") {
        $.setenv(theGroup_5c4e7860 = activeDocument.activeLayer.parent.name);
        $.setenv(theLayer_7e8fb92a = activeDocument.activeLayer.name);
    } else {
        alert("The selected layer isn't in a layer group!");
    }
} catch (e) { }

 

 

 

Script 2 of 2:

 

#target photoshop

// Script 2 of 2

try {
    activeDocument.activeLayer = activeDocument.layers[theGroup_5c4e7860];
    // Expand active group by jazz_y
    var g = (ad = activeDocument).activeLayer;
    if (g.typename == 'LayerSet' && g.layers.length) ad.activeLayer = g.layers[0];
    ad.activeLayer = g;
    activeDocument.activeLayer = activeDocument.layerSets[theGroup_5c4e7860].layers[theLayer_7e8fb92a];
} catch (e) {}

 

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html