-
1. Re: Batch script in Photoshop to remove background. Path has different name.
c.pfaffenbichler Aug 16, 2013 12:02 AM (in response to Faniskogen)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.
-
2. Re: Batch script in Photoshop to remove background. Path has different name.
Faniskogen Aug 19, 2013 2:26 AM (in response to c.pfaffenbichler)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.
-
3. Re: Batch script in Photoshop to remove background. Path has different name.
c.pfaffenbichler Aug 19, 2013 2:29 AM (in response to Faniskogen)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.
-
4. Re: Batch script in Photoshop to remove background. Path has different name.
Faniskogen Aug 19, 2013 2:42 AM (in response to c.pfaffenbichler)Ops, sorry. I thought that was the same thing.
Is there a way to make the photoshop action I've created select just the first path and not just the one named "path 1"?
Or is this better done with something else than the actions in photoshop?
-
5. Re: Batch script in Photoshop to remove background. Path has different name.
c.pfaffenbichler Aug 19, 2013 3:23 AM (in response to Faniskogen)Or is this better done with something else than the actions in photoshop?
Yes, with a Script.
One can include Scripts in Actions, though.
-
6. Re: Batch script in Photoshop to remove background. Path has different name.
c.pfaffenbichler Aug 19, 2013 7:02 AM (in response to Faniskogen)Paste the following text into a new file in ExtendScript Toolkit (part of Photoshop’s installation, Applications/Utilities/Adobe Utilities/ExtendScript Toolkit … and save it as a jsx-file into Photoshop’s Presets/Scripts-folder.
After restarting Photoshop the Script should be available under File > Scripts and can be assigned a Keyboard Shortcut directly, recorded into an Action, be used in a Configurator-Panel or started from ExtendScript Toolkit directly.
// 2013, use it at your own risk;
#target photoshop
if (app.documents.length > 0) {
if (app.activeDocument.pathItems.length > 0) {
var thePath = app.activeDocument.pathItems[0];
app.activeDocument.selection.selectAll();
thePath.makeSelection(0, true, SelectionType.DIMINISH);
}
};

