Ich habe tatsächlich die Antwort auf den Photoshop-Foren über Adobe. Es stellt sich heraus, dass Photoshop CS4 vollständig über JavaScript, VBScript, skriptfähig ist und mit einer wirklich tollen Entwicklungs-IDE geliefert wird, die alles bietet, was Sie erwarten (Debugger, Beobachtungsfenster, Farbcodierung und mehr). Ich war total beeindruckt.
Es folgt ein Auszug Referenz:
können Sie das folgende Skript ausführen, die einen neuen Ordner aus dem bestehenden und Batch erstellen wird geteilt, alle Dateien, um sie zu benennen existingFileName # 001.png und sie in der neue Ordner (bearbeitet)
#target Photoshop
app.bringToFront;
var inFolder = Folder.selectDialog("Please select folder to process");
if(inFolder != null){
var fileList = inFolder.getFiles(/\.(jpg|tif|psd|)$/i);
var outfolder = new Folder(decodeURI(inFolder) + "/Edited");
if (outfolder.exists == false) outfolder.create();
for(var a = 0 ;a < fileList.length; a++){
if(fileList[a] instanceof File){
var doc= open(fileList[a]);
doc.flatten();
var docname = fileList[a].name.slice(0,-4);
CropStraighten();
doc.close(SaveOptions.DONOTSAVECHANGES);
var count = 1;
while(app.documents.length){
var saveFile = new File(decodeURI(outfolder) + "/" + docname +"#"+ zeroPad(count,3) + ".png");
SavePNG(saveFile);
activeDocument.close(SaveOptions.DONOTSAVECHANGES) ;
count++;
}
}
}
};
function CropStraighten() {
function cTID(s) { return app.charIDToTypeID(s); };
function sTID(s) { return app.stringIDToTypeID(s); };
executeAction(sTID('CropPhotosAuto0001'), undefined, DialogModes.NO);
};
function SavePNG(saveFile){
pngSaveOptions = new PNGSaveOptions();
pngSaveOptions.embedColorProfile = true;
pngSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
pngSaveOptions.matte = MatteType.NONE;
pngSaveOptions.quality = 1;
pngSaveOptions.PNG8 = false; //24 bit PNG
pngSaveOptions.transparency = true;
activeDocument.saveAs(saveFile, pngSaveOptions, true, Extension.LOWERCASE);
}
function zeroPad(n, s) {
n = n.toString();
while (n.length < s) n = '0' + n;
return n;
};
Besuchen here für eine vollständige Post.
Haben Sie versucht, Google? Tipp CodeProject ... –