InDesign CS3 print to Postscript

Hi Folks-

I’m porting some scripts from CS2>CS3 and having some trouble. According to the manual, the following code should generate a postscript file on the desktop.

When I set the Print Preset definition to Printer: Postscript® File ; PPD: Device Independent - I get no output

When I set the Print Preset definition to Printer: HP Laserjet 4250 ; PPD: HP Laserjet 4250 - it sends the file to the printer

When I set the Print Preset definition to Printer: Adobe PDF 8.0; PPD: Device Independent - it send the file to the PDF distiller and no postscript file is visible.


tell application "Adobe InDesign CS3"
	tell print preferences of active document
		set printer to postscript file
		set print file to "Macintosh HD:Users:aisadm:Desktop:841267.ps"
	end tell
		print active document using "Color 8.5X11" without print dialog
end tell

:frowning:

-Ralph

It looks like in your final print active document line you are specifying a preset. That might be messing it up. I always set all of the options manually and don’t use presets. This is the code from a script of mine that prints separations to a postscript file on the desktop. This should get you started:

set PathToDesktop to path to the desktop as text
tell application "Adobe InDesign CS3"
	activate
	tell active document
		--First check if there are missing or modified images
		set theLinkStatus to ((get status of every link) as string)
		if ((theLinkStatus contains "link") or (theLinkStatus contains "lmis") or (theLinkStatus contains "lood")) then
			with timeout of 9999 seconds
				set Respond2Error to the button returned of (display dialog "Warning! You have missing or modified images." buttons {"Process Anyway", "Skip"} default button 1 with icon 1 giving up after 9990)
			end timeout
			if Respond2Error is "Skip" then
				close saving no
				return
			end if
		end if
		set horizontal measurement units of view preferences to inches
		set vertical measurement units of view preferences to inches
		tell document preferences
			set pw to the page width
			set ph to the page height
			set document slug uniform size to true
			set slug top offset to 0
		end tell
		
		set myName to (name of it) as text
		set AppleScript's text item delimiters to {"."}
		set fileBase to first text item of (myName as string)
		set AppleScript's text item delimiters to {""}
		set PS_file_path to (PathToDesktop & fileBase & ".ps") as text
		
		tell print preferences
			set printer to postscript file
			set PPD to "AdobePDF 8.0"
			set print file to PS_file_path
			set color output to separations
			set trapping to off
			try
				set bleed chain to true
				set bleed top to 0
			end try
			set use document bleed to print to false
			set include slug to print to false
			set all printer marks to false
			set tile to false
			set page position to centered
			set print page orientation to portrait
			set paper size to custom
			set paper height to ph
			set paper width to pw
			set download PPD fonts to true
			set flattener preset name to "[High Resolution]"
			set flip to none
			set font downloading to complete
			set OPI image replacement to false
			set PostScript level to level 3
			set print layers to visible printable layers
			set print nonprinting to false
			set print spreads to false
			set scale mode to scale width height
			set scale height to 100
			set scale width to 100
			set scale proportional to true
			set send image data to optimized subsampling
			set sequence to all
		end tell --end tell print prefs
	end tell --end tell active doc
	display dialog ("Printing Separation") buttons "Printing" giving up after 1
	with timeout of 1800 seconds
		print active document without print dialog
	end timeout
	tell active document to close saving no
end tell --End tell InDesign

Is there any way to set this to scale to fit a letter size document? Or would it just be easier to add logic depending on the documents original size?