Highlighted

Automate > Batch keeps overwriting the current file.

New Here ,
Nov 17, 2020

Copy link to clipboard

Copied

Hi everyone, 

 

I am new to using Photoshop Actions but I created one that acheived my goal of opening a background image, applying a PNG overlay, Saving for Web, deleting the overlay layer, repeating the process with a few different overlays on the same background image, and closing the file. 

When I run the action on one backgroud image it works great. However, when I do Automate > Batch on an entire folder of background images it just keeps replacing the set of images over and over. 

I need to somehow append a name to each file so they dont overwrite. Here's an example of what I need from each background:


background_red-overlay.png

background_green-overlay.png

background_blue-overlay.png

 

If someone could help me with this I would greatly appreciate it!

TOPICS
Actions and scripting, How to, Import and export, Mac

Views

39

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Automate > Batch keeps overwriting the current file.

New Here ,
Nov 17, 2020

Copy link to clipboard

Copied

Hi everyone, 

 

I am new to using Photoshop Actions but I created one that acheived my goal of opening a background image, applying a PNG overlay, Saving for Web, deleting the overlay layer, repeating the process with a few different overlays on the same background image, and closing the file. 

When I run the action on one backgroud image it works great. However, when I do Automate > Batch on an entire folder of background images it just keeps replacing the set of images over and over. 

I need to somehow append a name to each file so they dont overwrite. Here's an example of what I need from each background:


background_red-overlay.png

background_green-overlay.png

background_blue-overlay.png

 

If someone could help me with this I would greatly appreciate it!

TOPICS
Actions and scripting, How to, Import and export, Mac

Views

40

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Nov 17, 2020 0
LEGEND ,
Nov 17, 2020

Copy link to clipboard

Copied

Batch uses the Action you chose, if the name and path of the resulting file/s are part of the recording that’s not a malfunction of Batch. 

Please provide meaningful screenshots including the fully expanded Action in the Actions Panel and the Layers Panel. 

 

If you need to amend filenames you will probably have to use a Script instead of an Action. Do you have any JavaScript experience? 

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 17, 2020 0
New Here ,
Nov 17, 2020

Copy link to clipboard

Copied

Screen Shot 2020-11-17 at 12.16.39 PM.pngScreen Shot 2020-11-17 at 12.16.49 PM.pngScreen Shot 2020-11-17 at 12.16.58 PM.pngScreen Shot 2020-11-17 at 12.17.12 PM.png

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 17, 2020 0
New Here ,
Nov 17, 2020

Copy link to clipboard

Copied

I collapsed the repitive place/exports bc its the same exact thing as above I just used a different overlay. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 17, 2020 0
New Here ,
Nov 17, 2020

Copy link to clipboard

Copied

I have no JavaScript experience but I am willing to try anything! 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 17, 2020 0
LEGEND ,
Nov 18, 2020

Copy link to clipboard

Copied

This would export a png with teh file’s name plus the actibe layer’s name. 

// 2020, use it at your own risk;
#target photoshop;
if (app.documents.length > 0) {
var myDocument = app.activeDocument;
// getting the name and location;
var docName = myDocument.name;
var basename = docName.match(/(.*)\.[^\.]+$/)[1];
var myDocument = app.activeDocument;
var docName = myDocument.name;  
try {var basename = docName.match(/(.*)\.[^\.]+$/)[1]} 
catch (e) {var basename = docName};
try {var docPath = myDocument.path}
catch (e) {var docPath = "~/Desktop"};
// layer name;
try {
var layername = myDocument.activeLayer.name;
var basename = basename + "_" + layername;
} catch (e) {};
// save png;
savePNG (myDocument, docPath, basename, "_a");
};
////// function to png //////
function savePNG (myDocument, docPath, basename, theSuffix) {
// weboptions;
var webOptions = new ExportOptionsSaveForWeb();
webOptions.format = SaveDocumentType.PNG;
webOptions.PNG8 = false;	
webOptions.transparency = true;
webOptions.interlaced = 0;
webOptions.includeProfile = false;
webOptions.optimized = true;
myDocument.exportDocument(new File(docPath+"/"+basename+theSuffix+".png"), ExportType.SAVEFORWEB, webOptions);
};

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 18, 2020 0
Adobe Community Professional ,
Nov 17, 2020

Copy link to clipboard

Copied

In the Batch interface, check/tick the "override action open" option...

 

Or remove or disable the open step from the action.

 

Batch opens files, so your action step to open an explicit file is conflicting with Batch, which is why it needs to be overriden or removed/disabled.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 17, 2020 1