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!

Reply to thread

#target photoshop;

app.bringToFront();

main();

function main(){

var inputFolder = Folder("/R/Marketing/Images/Batch Done");

if(!inputFolder.exists) {

    alert("Input folder does not exist");

    return;

    }

var outputFolder = Folder("/R/Marketing/Images/Batch To Go");

if(!outputFolder.exists) outputFolder.create();

var csv = File.openDialog("/R/Inventory/Test","CSV File:*.csv");

if(csv == null) return;

csv.open("r");

csv.encoding = "UTF-8";

var fileList = csv.read().split("\n");

csv.close();

//start at 1 to exclude header line. 0 if no header line

for(var a = 1;a<fileList.length;a++){

    if(fileList[a].length < 3) continue;

    var line = fileList[a].split(",");

    var file = File(inputFolder + "/" + line[0].toString());

    if(!file.exists) continue;

    app.open(file);

    //amend to suit.

    doAction("Whole","Pair_Kit_Batch");

    var outFile = File(outputFolder + "/" + line[1].toString() + ".jpg");

    SaveJPEG(outFile, 8);

    app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);

    }

    doAction("batch_to_go","DestinyMacrosRDrive201703161145");

};

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);

};




So it should be like that?


What is our favorite program/app? (Hint - it begins and ends with the letter P)
Back
Top