Skip to main content
Inspiring
January 9, 2019
Question

• "Filtering layers" isn't recorded in an "action"?

  • January 9, 2019
  • 4 replies
  • 1255 views

Hello -

I would like to create an action for a colleague of mine.

In the "process" I need to select ONLY the "smart object" layers.

To do this I'm using the filtering option in the "layers" palette.

Unfortunately it works perfectly manually, but t isn't not recorded into the action.

Is there another way to select only the "smart object" layers (with the possibility to record it in an action)?

Thank you,

- Dimitri

This topic has been closed for replies.

4 replies

D Fosse
Community Expert
Community Expert
January 11, 2019

Not so sure this would work anyway. The layer name is what is recorded in the action, not layer type or any other attribute.

If names differ, the action just stops. The only relative layer selection allowed is counting up or down from the active layer.

That you can do it manually is no guarantee it will work in an action. You can think; the action doesn't.

Stephen Marsh
Community Expert
Community Expert
January 10, 2019

I wonder if there is a way to change the AM code below, perhaps the “undefined” bit?

var idlayersFiltered = stringIDToTypeID( "layersFiltered" );

executeAction( idlayersFiltered, undefined, DialogModes.NO );

Just like an action, the key bit is not recorded...

Inspiring
January 11, 2019

Hello Stephen -

Thank you for your input…

Where do you put this piece of code? in the script of Lumigraphics?

Thank you again.

- Dimitri

Stephen Marsh
Community Expert
Community Expert
January 11, 2019

Sadly you can’t/don’t use the code, unless it can be modified (I was lamenting the fact that despite the smart object layer filter being recorded by ScriptListener, the AM code did not actually do anything).

Bojan Živković11378569
Community Expert
Community Expert
January 10, 2019

If your Smart Object layers are always in the same count and same naming convention or Smart Object layers are ordered one above another in the Layers panel then it can be done, otherwise if you want to use action in any document just to select all smart object layers regardless of their count, position, naming convention it cannot be done (recorded as action step) using filtering options in the Layers panel.

Legend
January 9, 2019

You can write a script to select Smart Object layers, and call that from an action.

Inspiring
January 10, 2019

Hello Lumigraphics -

Thank you for your reply.

Now… hmmm I have no clue how to script that.

Any idea?

Thank you.

- Dimitri

Legend
January 10, 2019

This is a stub that will select Smart Object layers in sequence for you to do whatever processing you need. Feel free to use this as a starting point.

#target photoshop

layerSelect();

function layerSelect(){

     var docRef = activeDocument;

     for(var i = 0; i < docRef.artLayers.length; i++){

        var LayerRef = docRef.artLayers;

        if(LayerRef.kind == LayerKind.SMARTOBJECT){

            docRef.activeLayer = LayerRef;

            //do stuff in here

            }

        }

    }