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;|
|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?
it works fine here, W7 CS5
try restarting both the ESTK and Illustrator and try again, both programs get cranky after a bunch of script runs.
No such luck. That was the first thing I tried. I'm using CC.
Fixed. This had to do with some code earlier i nthe script. I had moved some objects from one document into the document I was exporting. Instead of moving, I duplicated them into the new document (with new variable names) and then removed the old one. This fixed the crashing issue for some reason.