AppleScript/JavaScript to Export PNG, JPG, PDF at Custom DPI – Error at 300 DPI
Hello Everyone,
I’m writing a script (AppleScript or JavaScript) to export an active document to PNG, JPG, and PDF in Adobe Illustrator.
So far, exporting at 72 DPI works fine, but when I try to set a different DPI (e.g., 300 DPI), I encounter errors.
Example Issue (AppleScript, PNG Export)
When exporting PNG (PNG24) at 300 DPI, I use:
export current document to file myFile as PNG24 with options {class:PNG24 export options, transparency:true, resolution:300}
However, this results in an error:
“PNG Export Failed: Adobe Illustrator got an error: Can’t get document 1.”
What I Need Help With
1. How can I correctly set PNG resolution to 300 DPI in AppleScript?
2. Is there a JavaScript solution that ensures PNG exports at the correct DPI?
3. How can I properly export JPG at a different DPI (e.g., 300 DPI) without Illustrator resizing the image?
Would appreciate any insights on how to properly handle custom DPI exports in AppleScript or JavaScript.
Thanks in advance!
