Skip to main content
Participant
December 14, 2012
Question

Batch processing with filename filter

  • December 14, 2012
  • 2 replies
  • 1785 views

Hi guys,

Does anyone have any idea how to run a specific action in batch along with a filename filter?

My problem is I have a folder with subfolders ie...  0001, 0002, 0003, 0004 etc   all these folders have approx 100 jpg files with the same filenames in each.

a sample of my images are: landscape-oraange.jpg , landscape-blue.jpg , landscape-red.jpg , portrait-orange.jpg etc etc

I was wonder of a way to just run the specific batch action on filenames containing a certain word, for instance to apply to all files containing the word "landscape" and exclude all other files.

I cannot copy all files under the subfolders to a seperate folder and run this way... as all filenames are the exact same as the other folders.

Does anyone have any advise?

Thanks again guys,   Jamie.

This topic has been closed for replies.

2 replies

Paul Riggott
Inspiring
December 14, 2012

That would have to be a custom script.

Alternatives might be...

Select the files in Bridge and run Image Processor / Image Processor Pro

Same again for Picture Processor.

http://www.scriptsrus.talktalk.net/PP.htm

Picture processor also allows you to run one action on portrait and a different action if landscape

c.pfaffenbichler
Community Expert
Community Expert
December 14, 2012

I think Cloud License version of Photoshop is supposed to allow for conditional clauses in Actions now.

But I don’t use the Cloud License so I can’t test this.

c.pfaffenbichler
Community Expert
Community Expert
December 14, 2012

I would recommend foregoeing the Batch and doing the operation from a Script with Folder selection.

How complex are the Actions?

Participant
December 14, 2012

I've not really got a clue about scripting to be honest, I can read it and kind of work out what it means but I can't program this.  I would have assumed that there must have been a plugin made for this since I thought it would have been quite a popular request. The actions are simple basically just placing a transparent png ontop of the image then save. Pretty simple really but I've got 70,000+ (approx 100 images per folder) but within each folder there would be approx 10 files to be excluded from this (containing a different filename)

Thanks Jamie.

c.pfaffenbichler
Community Expert
Community Expert
December 15, 2012

This might provide not quite what you are looking for but something similar.

Insert the correct Action and Set names in the line

app.doAction("Action 3", "Set 1")

and change the variable theIdentifier to the name part you want to use as a criterium.

This would work only if there are no spaces in the names by the way.

// 2012, use it at your own risk;

#target photoshop

// select folder;

var theFolder = Folder.selectDialog ("select folder");

if (theFolder) {

// define the name part to look for;

var theIdentifier = "Untitled";

var theFiles = theFolder.getFiles(new RegExp(theIdentifier+"\\S*.(jpg|tif|eps|psd)$", "i"));

// work through the files;

for (var m = 0; m < theFiles.length; m++) {

// open image;

var theImage = app.open(theFiles);

// perform action;

app.doAction("Action 3", "Set 1")

}

};