(InDesign) Export JPG in multiple resolutions
Hello,
I have got a script which exports all pages at 72dpi and it works perfectly but I am now trying to work out a way to get it to also export at 144 + 216dpi (in the same script). The file name also needs to add '_1x' / '_2x' / '_3x' to the end of the filename. The current script does everything but the different resolutions.
I could create 3 separate scripts but I need to create one script for JPG and another for PNG so I would prefer (if possible) to just have 2 scripts as opposed to 6 - even better would be to have one script that has a popup at the start to choose whether it is a JPG or PNG that we would like to export.
I have a similar script for exporting PDFs which is almost does exactly what we need for this but as JPG/PNG as opposed to PDFs.
If anyone knows of any scripts available you would be a life saver!
var doc = app.activeDocument;
var myFolder = doc.filePath;
var jpg_name = doc.name.replace(/.indd$/i, "");
for(var p = 0; p < doc.pages.length; p++) {
var myPageName = doc.pages[p].name;
// Set JPEG export preferences 1x
app.jpegExportPreferences.properties = {
antiAlias: true,
embedColorProfile: true,
exportResolution: 72,
// exportingSpread: true, // Uncomment if spreads
jpegColorSpace: JpegColorSpaceEnum.rgb,
jpegExportRange: ExportRangeOrAllPages.exportRange,
jpegQuality: JPEGOptionsQuality.maximum,
jpegRenderingStyle: JPEGOptionsFormat.baselineEncoding,
useDocumentBleeds: false,
simulateOverprint: false,
pageString: myPageName,
}
doc.exportFile(ExportFormat.jpg, File(myFolder +"/"+ jpg_name +"_"+"1x"+ ".jpg"), false);
}
alert("Done Exporting jpg's!");
