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!
doAction("ActionName","ActionSet");
#target photoshop;
app.bringToFront();
main();
function main(){
var inputFolder= Folder.selectDialog ("Please select folder to process");
if(inputFolder == null) return;
var outputFolder = Folder(inputFolder + "/processed");
if(!outputFolder.exists) outputFolder.create();
var filelist = inputFolder.getFiles("*.jpg");
for (var x in filelist){
var Name = filelist[x].name.replace(/\.[^\.]+$/, '');
var num = Name.match(/(\d+)[^\d]*$/)[1];
if(Number(num)%2){
//odd number
app.open(filelist[x]);
//modify the line below to show your actionname and action set
//this is your action for the watermark
doAction("ActionName","ActionSet");
var saveFile = File(outputFolder + "/" + filelist[x].name);
SaveJPEG(saveFile,8);
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
}
}
};
function SaveJPEG(saveFile, jpegQuality){
jpgSaveOptions = new JPEGSaveOptions();
jpgSaveOptions.embedColorProfile = true;
jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
jpgSaveOptions.matte = MatteType.NONE;
jpgSaveOptions.quality = jpegQuality;
activeDocument.saveAs(saveFile, jpgSaveOptions, true,Extension.LOWERCASE);
};
#target photoshop;
app.bringToFront();
main();
function main(){
var inputFolder= Folder.selectDialog ("Please select folder to process");
if(inputFolder == null) return;
var outputFolder = Folder(inputFolder + "/processed");
if(!outputFolder.exists) outputFolder.create();
var filelist = inputFolder.getFiles(/\.(jpg|tif)$/i);
for (var x in filelist){
var Name = filelist[x].name.replace(/\.[^\.]+$/, '');
var num = Name.match(/(\d+)[^\d]*$/)[1];
if(Number(num)%2){
//odd number
app.open(filelist[x]);
//modify the line below to show your actionname and action set
//this is your action for the watermark
doAction("ActionName","ActionSet");
var saveFile = File(outputFolder + "/" + Name + ".tif");
SaveTIFF(saveFile,8);
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
}
}
};
function SaveTIFF(saveFile){
tiffSaveOptions = new TiffSaveOptions();
tiffSaveOptions.embedColorProfile = true;
tiffSaveOptions.alphaChannels = true;
tiffSaveOptions.layers = true;
tiffSaveOptions.imageCompression = TIFFEncoding.NONE;
activeDocument.saveAs(saveFile, tiffSaveOptions, true, Extension.LOWERCASE);
};