Skip to main content
Participant
June 25, 2020
Answered

Selecting all layers in an action

  • June 25, 2020
  • 3 replies
  • 3501 views

I would like to create an action that selects ALL layers, then merges them (and then does some other stuff).  I can NOT use Flatten Image because that gets rid of the transparency.  I need to select ALL layers, then do a Merge, which leaves the transparency, but I don't see any way to automate the selecting of all layers.  Is there a keyboard shortcut I'm missing, or some kind of trick to do this, or is it just not possible?

Correct answer Conrad_C

You should be able to click the Actions panel menu, choose Insert Menu Item, and insert the Select > All Layers command.

3 replies

Stephen Marsh
Community Expert
Community Expert
June 25, 2020

Just for the record, another method that does not require layers to be selected (as select all layers does not always do that):

 

  1. Select All
  2. Copy Merged
  3. Flatten
  4. Paste Special - Paste in Place
  5. Delete Background layer

 

Update:

selectAllLayers();

          function selectAllLayers() {
                // https://feedback.photoshop.com/photoshop_family/topics/i-cant-record-sellect-all-layers-in-script-listener-and-in-actions
                var c2t = function (s) {
                    return app.charIDToTypeID(s);
                };

                var s2t = function (s) {
                    return app.stringIDToTypeID(s);
                };

                var descriptor = new ActionDescriptor();
                var descriptor2 = new ActionDescriptor();
                var reference = new ActionReference();
                var reference2 = new ActionReference();

                reference2.putEnumerated(s2t("layer"), s2t("ordinal"), s2t("targetEnum"));
                descriptor.putReference(c2t("null"), reference2);
                executeAction(s2t("selectAllLayers"), descriptor, DialogModes.NO);
                reference.putProperty(s2t("layer"), s2t("background"));
                descriptor2.putReference(c2t("null"), reference);
                descriptor2.putEnumerated(s2t("selectionModifier"), s2t("selectionModifierType"), s2t("addToSelection"));
                descriptor2.putBoolean(s2t("makeVisible"), false);
                try {
                    executeAction(s2t("select"), descriptor2, DialogModes.NO);
                } catch (e) { }
            }
Bojan Živković11378569
Community Expert
Community Expert
June 25, 2020

I think keyboard shortcut is Ctrl + Alt + A. It should record step: - Select All Layers current layer -. 

 

Note in case that you need: Background layer won't be selected. If you want and Background layer selected then select it using Alt + , {comma} then click on padlock icon to convert Background to normal layer then use Ctrl + Alt + A to select all layers.

Conrad_C
Community Expert
Conrad_CCommunity ExpertCorrect answer
Community Expert
June 25, 2020

You should be able to click the Actions panel menu, choose Insert Menu Item, and insert the Select > All Layers command.