Scripting: Batch selecting/deleting background
Hello, I'm trying to write a JS script for Photoshop CS unfortunately I'm very new to js and can't find a way to solve it.
I have a batch of image files with a background that I want to delete/ or set white. Sample images below.
I do it manually with a 'quick selection tool'. I select the tool, press left button in the left top corner and move it right-down-left-top which selects the background. Right click and now I create a new layer via cutting which splits the background and the main picture. I delete the background and save the picture in a different folder.
I tried action manager but it doesnt record everything and it cant select the background.


Thank you for your help
