Illustrator CS (v 11.0.0) Postscript/Custom size...Sooo close....

First, I’d like to once again thank everyone for all the help so far. Thank you.

I know I’ve posted on this topic a number of times before, but I’ve yet to get it to work correctly.
I’ve also double-checked my old posts, and have not found anything to further my script.

This script, almost, works great…



tell application "Illustrator CS"
	set user interaction level to never interact
	
	set h to height of current document
	set w to width of current document
	
	set docName to get the name of the current document
	
	set filepath to "DistillerIHT:In:" as Unicode text
	
	set FullPath to filepath & docName & ".ps"
	
	set ppd to "Adobe PDF" as Unicode text
	
	set printerName to "Adobe PostScript® File" as Unicode text
	
	
	set paperOpts to {class:paper options, height:h, width:w}
	--set paperProps to {class:paper properties, custom paper:true, height:h, width:w}
	
	set postOpts to {class:postscript options, PostScript:level 2}
	
	set jobOpts to {class:job options, print as bitmap:false, file path:FullPath}
	
	set opts to {class:print options, job settings:jobOpts, postscript settings:postOpts, printer name:printerName, PPD name:ppd, paper options:paperOpts}
	
	print current document options opts
	
	set user interaction level to interact with all
end tell

However the most important part of it does not. That being the custom size part. None of our graphics are of any kind of normal size, and they change size daily.

When I make this active: (either both lines or just one at a time)

 set paperOpts to {class:paper options, height:h, width:w}
 set paperProps to {class:paper properties, custom paper:true}

(and of course I add to the overall opts at the end of the script so that it’s aware.)

When I make it active, it tells me that it cannot get the current document, which is very odd to me.

Any help is greatly appreciated. Thanks.

bradevans,

I think this works. Give it a shot.

set filepath to (path to desktop as string) & "Test:" as Unicode text

tell application "Illustrator CS"
	set user interaction level to never interact
	
	set h to height of current document
	set w to width of current document
	
	set docName to get the name of the current document
	
	set ppd to "Adobe PDF" as Unicode text
	
	set FullPath to filepath & docName & ".ps"
	
	set printerName to "Adobe PostScript® File" as Unicode text
	set paperOpts to {class:paper options, height:h, width:w}
	set postOpts to {class:postscript options, PostScript:level 2}
	
	set jobOpts to {class:job options, print as bitmap:false, file path:FullPath}
	
	set opts to {class:print options, job settings:jobOpts, postscript settings:postOpts, printer name:printerName, PPD name:ppd, paper settings:paperOpts}
	
	print document 1 options opts

PreTech

PS I changed the file path to match my computer. Is your original file path working with other page sizes? It seems to be missing the rest of the path - hardDrive:Users:userName:Desktop:wherever: - kind of thing.