What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Batch Automation Advanced Action/Batch - Need help


veryferry

Member
Messages
7
Likes
0
(Sorry moderator, for trying to post this multiple times on various wrong locations)


Dear Gurus,

I have multiple (400+) folders, each containing 3 .tga files. The names of those 3 files are the same in every folder (beauty, ambient & outline). I'm looking for a way to do the following:

Step 1: Open beauty.tga
Step 2: Use the alpha channel to duplicate the subject into a new layer
Step 3: Rename this layer to "beauty"
Step 4: Delete the Background layer
Step 5: Open ambient.tga
Step 6: Use the alpha channel to duplicate the subject into a new layer
Step 7: Rename this layer to "ambient"
Step 8: Copy this "ambient" layer to beauty.tga
Step 9: Set the layer style of the "ambient" layer to Multiply
Step 10: Open Outline.tga
Step 11: Use the alpha channel to duplicate the subject into a new layer
Step 12: Rename this layer to "outline"
Step 13: Copy this "outline" layer to beauty.tga
Step 14: Save beauty.tga as a .PSD file
Step 15: Automatically repeat these steps for every single one of those 400+ folders.

Actually, I did manage to get the first 14 steps working, but...
Now the "open" commands within the action refer to actual files, instead to filenames within a certain folder. So every time I play the action, it just uses the exact files I used when I was recording. Makes sense of course, but that way I can't apply the action to multiple folders.

Any ideas/solutions?

Thanks!
 

colleague

Guru
Messages
824
Likes
1,254
you could try to make an action that starts with the 3 files open (ambient beauty and outline)

and a script that opens 3 files ; does the action and continue with the next folder

I made an example-script that asks to browse to the folder with 400 subfolders
and it works only with the action with the name 'testing' and the action-set with the name "Set test"

// use it at your own risk;
#target photoshop
// select a folder;
var sourceFolder = Folder.selectDialog("Select folder");
if (sourceFolder) {
var theContent = sourceFolder.getFiles();
//alert (sourceFolder);
// iterate through;
for (var m = 1; m < theContent.length+1; m++) {

var folderName = theContent[m-1].name;
var myNewFolder = new Folder( decodeURI(theContent[m-1].path) +"/"+folderName+"/");
//open the 3 files

app.open(File(decodeURI(myNewFolder)+"/"+"ambient.tga"));
app.open(File(decodeURI(myNewFolder)+"/"+"beauty.tga"));
app.open(File(decodeURI(myNewFolder)+"/"+"outline.tga"));
//alert(m);
//
doAction( 'testing','Set test' );
//Case Sensitive Action Name, Set Name
//close all documents
while(app.documents.length > 0)
{
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
}
};
};
 

veryferry

Member
Messages
7
Likes
0
Thanks! I will look into this when I have a new batch. The 400+ folders are already done by hand now :p
Well...still used an action, but it meant a lot of copy/paste :p
 

Top