Skip to main content
August 14, 2013
Question

Batch script in Photoshop to remove background. Path has different name.

  • August 14, 2013
  • 1 reply
  • 3633 views

Hi,


I would like to make a script that selects a saved path in a image, invert the selection to select the background and then remove that area or color it white.

That's not a problem as long as all the path's in the images are named the same. My problem is that the pathes in the images are named different. I want photoshop to just select the first or the only path in the list and don't go by name.

Does anyone have a solution to this?

Thanks

This topic has been closed for replies.

1 reply

c.pfaffenbichler
Community Expert
Community Expert
August 14, 2013

if (app.activeDocument.pathItems.length > 0) {

var thePath = app.activeDocument.pathItems[0]

};

should identify the first path.

I would like to make a script that selects a saved path in a image, invert the selection to select the background and then remove that area or color it white.

Why do you want to do that?

I think I have received some images (from stock image sites for example) that seem to have been treated thusly and they were usually the worse for it.

August 19, 2013

Thank you!

Now, how do I add that text to my action? I've done some searching but have had no luck finding a way to add the text to my action.

I got a lot of images with good paths that needs white background. The problem is that the name of some path's are different than the most other. This causes the action to stop the process.

c.pfaffenbichler
Community Expert
Community Expert
August 19, 2013

Now, how do I add that text to my action?

You stated

I would like to make a script

so I assumed you werde talking about Scripts, not Actions.