Skip to main content
Participant
October 21, 2018
Question

Batch delete layer by name

  • October 21, 2018
  • 2 replies
  • 2866 views

Does anyone have a script to delete a layer by name that I can use on a number of files? For example, I would like to delete the layer named "text" from a number of Photoshop files. It would be fine to either delete the layer in all the files open in Photoshop or to have the script process a folder. Thanks!

This topic has been closed for replies.

2 replies

Inspiring
October 21, 2018

app.activeDocument.activeLayer.getByName("text").remove();

Participant
October 22, 2018

app.activeDocument.activeLayer.getByName("text").remove();

Thanks

pixxxelschubser
Community Expert
Community Expert
October 21, 2018

"text" as name standalone or

"text" included somewhere in layer name?

"text" layer name only one time exists per document or

more times?

"text" layer name is only in top level layers or

maybe deep nested in layer sets?

Delete a layer by name - it seems to be so easy …

Participant
October 22, 2018

"text" as name standalone or

"text" included somewhere in layer name? Standalone

"text" layer name only one time exists per document or

more times? One time

"text" layer name is only in top level layers or

maybe deep nested in layer sets? Top level layer