Java Script - saving export directory
Hi, let me begin by disclosing that I only have a very basic grasp of Java scripting. Assume nothing! ![]()
I am using a script which loads an InDesign template, imports images and text, exports a jpeg to one directory and saves the indd to another directory. Normally when you save an indd it also saves the last directory it was exported to. In this case it doesn't do that. If I manually re-export the jpeg the default directory is the same as that where the indd is saved and not the directory that the script exports to. So my question is, is there a way to force the export diectory to be saved? Relevant script section below. TIA ![]()
| JavaScript |
|---|
if ( renderFile) { app.jpegExportPreferences.jpegQuality = JPEGOptionsQuality.maximum; // low medium high maximum app.jpegExportPreferences.exportResolution = 254; app.jpegExportPreferences.jpegExportRange = ExportRangeOrAllPages.exportRange; app.jpegExportPreferences.pageString = "1";
var quantity = my_JSON_object.Quantity; var myFilePath = mySavePath+"/" + jobNumber + " " + finalImageName + "." + quantity + ".jpg"; var myFile = new File(myFilePath);
myDoc.exportFile(ExportFormat.jpg, myFile, false);
saveIndd(myDoc,myFolder,finalImageName,quantity) ;
} else { alert ("Error Creating File"); } } // ######################## SAVE INDD function saveIndd( myDoc,myFolder,finalImageName,quantity) { var inddFile = new File ( myFolder+"/" + jobNumber + " " + finalImageName + "." +quantity + ".indd"); myDoc.save( inddFile )
myDoc.close(); } |
