Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
#target photoshop
var myDocument = app.activeDocument;
var docName = myDocument.name;
var baseName = docName.match(/(.*)\.[^\.]+$/)[1];
var docPath = myDocument.path;
var jpgOptions = new JPEGSaveOptions();
jpgOptions.embedProfile = true;
jpgOptions.formatOptions = FormatOptions.STANDARDBASELINE;
jpgOptions.matte = MatteType.NONE;
jpgOptions.quality = 10;
theFolder = Folder.selectDialog("select a folder to save the jpgs to");
var theStart = myDocument.activeHistoryState;
var theScenes = new Array;
var theSubjects = new Array;
for (var m = 0; m < myDocument.layers.length; m++ ) {
var theLayerName = myDocument.layers.name;
switch (theLayerName.slice(0, 5)) {
case "scene": theScenes = theScenes.concat (theLayerName);
break;
case "subje": theSubjects = theSubjects.concat (theLayerName);
break}
};
for (var n = 0; n < myDocument.layers.length; n++ ) {
myDocument.layers.visible = false;
};
for (var o = 0; o < theScenes.length; o++ ) {
myDocument.layers[ theScenes].visible = true;
for (var p = 0; p < theSubjects.length; p++ ) {
myDocument.layers[ theSubjects].visible = true;
var theCopy = myDocument.duplicate (theCopy, true);
theCopy.bitsPerChannel = BitsPerChannelType.EIGHT;
theCopy.saveAs((new File(theFolder+"/"+baseName+"_"+theScenes.slice(-1)+"_"+theSubjects .slice(-1)+".jpg")),jpgOptions,true);
theCopy.close(SaveOptions.DONOTSAVECHANGES);
myDocument.layers[ theSubjects].visible = false
};
myDocument.layers[ theScenes].visible = false;
};
myDocument.activeHistoryState = theStart;
// thats it; thanks to xbytor;
// use it at your own risk;
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Find more inspiration, events, and resources on the new Adobe Community
Explore Now