I am deep into an applescript studio application that basically runs a predetumined path of events through illustrator. When I go to same the document in a location that is alread defined the app comes back with the error:
Adobe Illustrator CS got an error: Can’t get current document. (-1728)
I can’t get around it. I have tried using “document 1”, document (name of document 1), document (current document)… but nothing seems to work. I can grab the properties like “name of document 1” but it can’t do anything with it (specifically saving it).
the code goes like this:
(saveFileLocation is basically the desktop with an ad number like 1234567890.eps)
tell application "Illustrator CS"
save current document in saveFileLocation as eps ¬
with options {class:EPS save options ¬
, CMYK PostScript:true ¬
, compatibility:Illustrator 11 ¬
, compatible gradient printing:true ¬
, embed linked files:true ¬
, embed all fonts:true ¬
, flatten output:preserve appearance ¬
, include document thumbnails:false ¬
, overprint:discard, PostScript:level 2 ¬
, preview:none ¬
, replacing:yes}
close of current document saving no
end tell