Trying to export multiple images from Photoshop. Current script works fine but I really need it to pad the numbers out, so instead of just "1" on the layer I get "001" for instance.
var directory = 'C:/Thumbs/';
var imageName = 'Thumb';
var numImages = 10;
function SaveJPEG(saveFile){
var doc = activeDocument;
if (doc.bitsPerChannel != BitsPerChannelType.EIGHT) doc.bitsPerChannel = BitsPerChannelType.EIGHT;
jpgSaveOptions = new JPEGSaveOptions();
jpgSaveOptions.embedColorProfile = true;
jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
jpgSaveOptions.matte = MatteType.NONE;
jpgSaveOptions.quality = 8;
activeDocument.saveAs(new File(saveFile), jpgSaveOptions, true,Extension.LOWERCASE);
}
var layer = activeDocument.layers[0];
if (layer.kind == 'LayerKind.TEXT') {
for (var i=1; i <= numImages; i++) {
layer.textItem.contents = i.toString();
SaveJPEG(directory + imageName + '_'+ i +'.jpg');
};
};