I have a script with the following at the end:
var pathName = "~/Desktop/salesChartEMC.pdf"; | |
var saveName = new File (pathName); | |
saveOpts = new PDFSaveOptions(); | |
saveOpts.compatibility = PDFCompatibility.ACROBAT5; | |
saveOpts.generateThumbnails = true; | |
saveOpts.preserveEditability = true; | |
templateFile.saveAs(saveName, saveOpts); | |
templateFile.close(SaveOptions.DONOTSAVECHANGES); | |
alert("PDF successfully saved as "+pathName); |
The script keeps crashing at the templateFile.close(...) line. If I comment out that line, the script works without crashing and I can switch back and forth between open documents and work as normally. However, as soon as I manually close the PDF that is still open, Illustrator crashes again. Has anyone run into this behavior before?