Skip to main content
This topic is closed to new replies. Start a new post to keep the conversation going.

12 replies

Participant
Dec 3, 2023 6:40 PM UTC

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

Translate
Stephen Marsh
Community Expert
Community Expert
Dec 3, 2023 9:36 PM UTC
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.

Translate
Kukurykus
Legend
Dec 19, 2021 2:34 PM UTC

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

Translate
Stephen Marsh
Community Expert
Community Expert
Dec 19, 2021 8:14 PM UTC

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

Translate
Inspiring
Dec 16, 2021 9:17 AM UTC

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.

Translate
Participant
Dec 16, 2021 9:43 AM UTC

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 🙂

Translate
Inspiring
Dec 16, 2021 10:18 AM UTC

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!

Translate