Skip to main content
Participant
December 16, 2021
Answered

Actions on multiple layers

  • December 16, 2021
  • 3 replies
  • 5129 views

Is it possible to run an action on multiple layers simultaneously?

This topic has been closed for replies.

3 replies

Participant
December 3, 2023

I want to remove the background on all layers with just one click

Stephen Marsh
Community Expert
Community Expert
December 3, 2023
quote

I want to remove the background on all layers with just one click


By @Remi24060989b4r3


So how are you successfully doing this manually (magic wand, select subject etc)? A script can perform the same steps, or run an action on each layer, but without knowing your steps or seeing a sample layered file it's hard to answer.

Kukurykus
Legend
December 19, 2021

Two of your links take to 'Apply Layer Mask to Numerous Layers (without grouping)'.

Stephen Marsh
Community Expert
Community Expert
December 19, 2021

Didn't mean to double up, but it is easy to swap the code for applying a layer mask for an action.

Inspiring
December 16, 2021

Not really.

You can select multiple layers and transform them in one go, but you cannot (for example) select multiple layers and run an action that would perform one blur and expect it to blur all selected layers.

 

You could achieve what you want by making a script in ExtendScript.

Participant
December 16, 2021

Thanks for the reply, much appreciated. I can now stop searching for something that doesn't exist, and stop loading up on layer tools that don't resolve my issue. Surely a plug in with such capability (& monopoly) would go well in the market. Ok, off to learn about ExtendScript now 🙂

Inspiring
December 16, 2021

You're welcome. 🙂

 

I remember my first script... I wish I had this information, so, let's get you started! 😄

The official documentation has gaps so not everything is documented. Sometimes you just wont find the answer there. When that happens, remember this forum, there's a bunch of great people here ready to help out.

 

To write an ExtendScript, Adobe recommends using VSCode + the ExtendScript Debugger Extension (made by Adobe).

The most important documents are here:

 

"app.activeDocument.activeLayer" gives you access to the currently selected layers. It returns something different depending on whether you have 0, 1 or more layers selected, so in your script you'll need to take that into account. You'll also need to think about how to handle adjustment layers vs artlayers vs shape layers.

 

Hope that helps you out, best of luck!