I am not sure what happened with Illustrator CS4 in regards to saving an Illustrator CS4 EPS file via scripting. Prior to CS4 this saving script would not tret the artboard as part of the file when placed into InDesign. With CS4, it as if Applescript is not sending some kind of resource fork to tell InDesign and the Finder what the EPS file is. Can anybody explain how I can save a new Illustrator document as an EPS without treating the artboard as part of the file?
tell application "Adobe Illustrator"
try
set origPath to file path of current document as Unicode text
-- Rather uselessly, Script Editor and TextEdit return POSIX paths here.
-- Here's a trap in case Illustrator does the same.
try
origPath as alias
on error
set origPath to origPath as POSIX file as Unicode text
end try
on error
set origPath to ""
end try
try
set currentName to name of current document
if (currentName does not end with ".eps") then set currentName to currentName & ".eps"
end try
if ((count origPath) > 0) then
set newFile to (choose file name with prompt "Save this document as." default location (origPath as alias) default name currentName)
else
set newFile to (choose file name with prompt "Save this document as." default name currentName)
end if
-- Check that the ".eps" hasn't been lost from the name.
repeat until ((newFile as Unicode text) ends with ".eps")
set newFile to (choose file name with prompt "The name you choose must have an ".eps" extension. Save this document as." default name ((newFile as Unicode text) & ".eps"))
end repeat
-- Create the new file if it doesn't exist.
try
open for access newFile
close access newFile
end try
save document 1 in file newFile as eps with options {compatibility:Illustrator 10, CMYK PostScript:true, embed all fonts:true, include document thumbnails:true, preview:color Macintosh}
end tell
Browser: Firefox 3.5.1
Operating System: Mac OS X (10.5)