Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
// create scopies with progressive numbers in a type layer;
// use it at your own risk;
#target photoshop
var myDocument = app.activeDocument;
// the following line would work on the active layer;
// var theLayer = myDocument.activeLayer;
// this line takes the topmost layer;
var theLayer = myDocument.layers[0];
// get the name and location;
var docName = myDocument.name;
var basename = docName.match(/(.*)\.[^\.]+$/)[1];
var docPath = myDocument.path;
// jpg-options;
var jpgopts = new JPEGSaveOptions();
jpgopts.embedProfile = true;
jpgopts.formatOptions = FormatOptions.STANDARDBASELINE;
jpgopts.matte = MatteType.NONE;
jpgopts.quality = 10;
// create the new numbers and save jpgs;
if (theLayer.kind == LayerKind.TEXT) {
// save the first one;
myDocument.saveAs((new File(docPath+"/"+basename+"_"+theLayer.textItem.contents+".jpg")),jpgopts,true);
// create the rest, enter the desired total number - 1 instead of »99«;
for (var m = 0; m < 99; m++) {
var newNumber = bufferNumberWithZeros(Number(theLayer.textItem.contents) + 1, 3);
theLayer.textItem.contents = newNumber;
myDocument.saveAs((new File(docPath+"/"+basename+"_"+newNumber+".jpg")),jpgopts,true);
}
}
else {
alert ("the topmost is not a text-layer")
};
////// buffer the numbers-function //////
function bufferNumberWithZeros (number, places) {
var theNumberString = String(number);
for (var o = 0; o < (places - String(number).length); o++) {
theNumberString = String("0" + theNumberString)
};
return theNumberString
};
I didnt include dialog to enter the intended number, but You can easily enough edit the Script itself according to the necessities, and I did it just for saving jpgs, again something You could change Yourself.
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
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