Paste the copied code into a new file in ExtendScript Toolkit (part of Photoshop’s installation, Applications/Utilities/Adobe Utilities/ExtendScript Toolkit CS4 or /Applications/Utilities/Adobe Utilities-CS5/ExtendScript Toolkit CS5) 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, (in CS4 and CS5) be used in a Configurator-Panel or started from ExtendScript Toolkit directly.
But if you aren’t in a hurry you may want to wait a bit, because I seem to remember there were threads and Scripting solutions offered to two-folder-tasks that may fit your needs better – I can’t currently locate them, but maybe one of their creators might drop by yet and provide the code or a link.
C. thanks again.
I found I can place the .jsx file into that scripts folder on my disk and then use "File > Scripts > Browse" to run it.
However, one image sequence is .png and the other is .tif, so will have to add some code, which I think I can do, to fix it.
Cheers
William
#target photoshop
var inputFolderA = Folder.selectDialog("Please select ImageA folder");
var inputFolderB = Folder.selectDialog("Please select ImageB folder");
var outputFolderE = Folder.selectDialog("Please select output Folder ImageE folder");
var fileList = inputFolderA.getFiles ("*.png");
var startRulerUnits = preferences.rulerUnits;
preferences.rulerUnits = Units.PIXELS;
for (var a = 0;a<fileList.length;a++){
var file =fileList;
var fileB = file.name.replace(/A/,"B");
fileB = file.name.replace(/png/,"tif");
var doc = open(file);
var Bimage = File(inputFolderB +"/" + fileB);
if(Bimage.exists) {
var b = open(Bimage);
activeDocument.selection.selectAll();
activeDocument.selection.copy();
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
activeDocument.paste();
}
var saveFile = File(outputFolderE +"/" +file.name.replace(/A/,"E"));
SavePSD(saveFile);
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
}
app.preferences.rulerUnits = startRulerUnits;
function SavePSD(saveFile){
psdSaveOptions = new PhotoshopSaveOptions();
psdSaveOptions.embedColorProfile = true;
psdSaveOptions.alphaChannels = true;
activeDocument.saveAs(saveFile, psdSaveOptions, true, Extension.LOWERCASE);
}