on printToPostscript()
local TID
set TID to AppleScript's AppleScript's text item delimiters
local docRef
local fileName
local newFileName
local theName
local filepath
local workingPath
local theHeight
local theWidth
local fullName
local paperOpts
local postOpts
local jobOpts
local fontOpts
local printOpts
tell application "Adobe Illustrator"
-- set a reference to the document we are working on
set docRef to document 1
tell docRef
-- get the name of the current document we may need it later
set fileName to name of docRef
set newFileName to my justFileName(fileName) -- drops the files extension
log newFileName
set filepath to file path of docRef as text
set workingPath to my getWorkingPath(filepath) -- gets just folders without filename
log workingPath
set theHeight to height of docRef
set theWidth to width of docRef
set fullName to workingPath & newFileName & ".ps"
set paperOpts to {class:paper options, height:theHeight, width:theWidth}
set postOpts to {class:postscript options, force continuous tone:true, image compression:none, PostScript:level 2}
set jobOpts to {class:job options, designation:all layers, file path:fullName}
set fontOpts to {class:font options, download fonts:subset}
set printOpts to {class:print options, font settings:fontOpts, job settings:jobOpts, paper settings:paperOpts, postscript settings:postOpts, PPD name:"Device Independent", printer name:"Adobe Postscript® File"}
print document 1 options printOpts without dialogs
end tell
end tell
-- set the text item delimiters back to what it was before we called the script
set AppleScript's text item delimiters to TID
end printToPostscript
I get the error “Adobe Illustrator got an error: File/Folder expected”. If you watch the results it even writes the postscript file. It seems like it doesn’t know where to put it. I though that’s what the job options file path was for. A place to save the file with that path and name.
Any ideas would be appreciated.
Thanks
Rich