I am trying to run a jsx script that will load an image, unlock the layer, use the "Remove Background" quick action, and save the image as a PNG. How do you trigger "Remove Background" quick action in scripts?
I have read through Adobe’s JavaScript documentation and don’t see anything about Quick Actions. I also read this post about triggering actions but did not see the "Remove Background" ATN file. I image is would look something like this:
app.doAction("RemoveBackground","RemoveBackground.ATN")
Is running the Remove Background quick action through scripts possible, and if so how do you do it?
2
Answers
You can execute an action with a script by using the following:
Where "my action",is the name of your action as a string – "remove background" and "my action Set" is the folder/ set in which it is in.
To remove a background simply search for the layer that has the flag
isBackgroundlayer
I know this is an old thread, but I found a solution described on Instructables and hosted at GitHub, which does work. This is not my solution but I have successfully used it.
The action that you use to remove the background seems to be a compound action in which you select the subject using something labeled "autoCutout" and then invert the selection. I don’t have enough knowledge to tell you anything more, other than that it works.
Warning: Photoshop did crash while I was using this.
Links here:
https://github.com/kavindupasan/batch-bg-remover-photoshop
https://www.instructables.com/Remove-Background-of-Multiple-Images-Using-Photosh/