var docRef = app.activeDocument;
var artboardsNum = docRef.artboards.length;
var destFolder = Folder.selectDialog('Select the folder to export the JPG files to:');
for (var i = 0; i < artboardsNum; i++) {
docRef.artboards.setActiveArtboardIndex(i);
if (destFolder) {
var destFile = new File(destFolder + '/Artboard ' + i + '.jpg');
var jpgExportOptions = new ExportOptionsJPEG();
jpgExportOptions.artBoardClipping = true;
docRef.exportFile (destFile, ExportType.JPEG, jpgExportOptions);
}
}
#target illustrator
var docRef = app.activeDocument;
var artboardsNum = docRef.artboards.length;
var destFolder = Folder.selectDialog('Select the folder to export the JPG files to:');
for (var i = 0; i < artboardsNum; i++) {
docRef.artboards.setActiveArtboardIndex(i);
if (destFolder) {
// Gheck file exists and rename
if (File(destFolder + '/Artboard_' + i + '.jpg').exists) {
//modTime — number of milliseconds since midnight January 1,1970 UTC
//for the date of the referenced file's last modification..
var modTime = File(destFolder + '/Artboard_' + i + '.jpg').modified.getTime();
File(destFolder + '/Artboard_' + i + '.jpg').
rename (destFolder + '/Artboard_' + i + "_" + modTime +'.jpg')
}
var destFile = new File(destFolder + '/Artboard_' + i + '.jpg');
var jpgExportOptions = new ExportOptionsJPEG();
jpgExportOptions.artBoardClipping = true;
docRef.exportFile (destFile, ExportType.JPEG, jpgExportOptions);
}
}
//save the layer as jpeg
var fileRef = new File ("~save_text_jpeg.ini");
fileRef.open ("r:");
var x = fileRef.read ();
var b = Folder.selectDialog ("Select a folder", x);
fileRef.open ("w:");
fileRef.write (b)
//оpen an ini file
var fileRef = new File ("~save_text_jpeg.ini");
fileRef.open ("r:");
var b = fileRef.read ();
//set up dialogmode
app.displayDialogs = DialogModes.NO;
//determine if a top layer object is a layer or a layerset
//in case of being a layerset select it's top layer as an active layer
//otherwise select a top layer object as an active layer
var y = app.activeDocument.layers [0];
//read the name content of an active layer
var c = app.activeDocument.activeLayer.name;
for (var i = 0; i < activeLayer; i++) {
docRef.app.activeDocument.activeLayer.name(i);
if (OutputFolder) {
// Gheck file exists and rename
if (File(OutputFolder + "/" + i +".jpg").exists) {
//modTime — number of milliseconds since midnight January 1,1970 UTC
//for the date of the referenced file's last modification..
var modTime = File(OutputFolder+ "/" + i +".jpg").modified.getTime();
File(destFolder + "/" + i +".jpg")
rename (OutputFolder + "/" + i + "_" + modTime +".jpg")
var OutputFile = new File(OutputFolder + c + i + '.jpg');
//save the file as jpeg
var OutputFolder = b
var jpegOptions = new JPEGSaveOptions();
jpegOptions.quality = 8;
app.activeDocument.saveAs (new File (OutputFolder + "/" + c +".jpg"), jpegOptions)
}
}