- Click THIS LINK to download the InDesign script.
- Click THIS LINK to download sample file/s (well, the script is already here also).
- trying to extract formatted images from indesign into a separate folder
- Indesign CS6 Scripting - Exporting images
- How do I create a folder using ExtendScript?
apis = myDoc.allPageItems, rect, fileName;
while ( rect = apis.pop() )
{
if ( !(rect instanceof Rectangle) || !rect.graphics[0].isValid ){ continue; }
fileName = File ( rect.graphics[0].itemLink.filePath ).name;
fileName = fileName.replace( /\.[a-z]{2,4}$/i, '.jpg' );
app.jpegExportPreferences.exportResolution = 72;
app.jpegExportPreferences.jpegQuality = JPEGOptionsQuality.MEDIUM;
//make new folder
var f = new Folder("c:/users/Shadouness/desktop/JPG webexport/");
f.create();
//give it a unique name
var myFile = new File('c:/users/Shadouness/desktop/JPG webexport/' + fileName);
rect.exportFile(ExportFormat.JPG, myFile);
}







