Quark Export to PDF

Hi all,

I am trying to script Quark to output a doc as a pdf file.
a few problems occur w the code i have which was constructed from various other posts i found here…
1- the file is huge, this is due to a lack of properties settings i think
2- i cant get the naming right, it wont create a string

any suggestions much appreciated

CODE:
tell application “QuarkXPress”
activate

set myDoc to document 1

-- determine new paper width, height and orientation 
set paper_width to (page width of myDoc) as number
set paper_height to (page height of myDoc) as number

if paper_width > paper_height then
	set newPaperHeight to (paper_width)
	set newPaperWidth to (paper_height)
	set myOrientation to landscape
else
	set newPaperWidth to (paper_width)
	set newPaperHeight to (paper_height)
	set myOrientation to portrait
end if



tell print setup of myDoc
	-- print setup settings 
	set printer type to "Generic PDF"
	
	set paper width to newPaperWidth
	set paper height to newPaperHeight
	set paper offset to 0
	set page gap to 0
	set reduce or enlarge to "100%"
	set fit in area to false
	set page position to center position
	set orientation to myOrientation
	
	-- print document settings 
	set seperation to false
	set print spreads to false
	set include blank pages to false
	set print thumbnails to false
	set back to front to false
	set page sequence to all pages
	set registration marks to centered
	set tiling to off
	
	
	
	-- print options settings 
	set flip horizontal to false
	set flip vertical to false
	set invert image to false
	set print quality to normal
	set full res rotated objects to false
	set data format to binary data
	
end tell
set PS_file_path to ("CO-OP:" & myDoc & ".ps")
set myDoc to PS_file_path
print myDoc PostScript file PS_file_path

end tell

i got hangups at

set printer type to "Generic PDF"

– i didn’t have that printer description, so i’m not sure if Quark was freaking out because of that … I’ve never seen that PPD myself, so I inserted “Acrobat Distiller” instead. Besides, when you choose “Generic” anything in the PPD you don’t normally have access to change paper size

I also redid the ending bit; you can put your path back in if you like.

This script printed out a .ps file on my desktop, so I’m pretty sure it works.

tell application "QuarkXPress"
	activate
	
	
	set myDoc to (document 1)
	
	-- determine new paper width, height and orientation 
	set paper_width to (page width of myDoc) as number
	-- display dialog paper_width
	set paper_height to (page height of myDoc) as number
	-- display dialog paper_height
	if paper_width > paper_height then
		set newPaperHeight to (paper_width)
		set newPaperWidth to (paper_height)
		set myOrientation to landscape
	else
		set newPaperWidth to (paper_width)
		set newPaperHeight to (paper_height)
		set myOrientation to portrait
	end if
	
	
	
	tell print setup of myDoc
		-- print setup settings 
		set printer type to "Acrobat Distiller"
		
		set paper width to newPaperWidth
		set paper height to newPaperHeight
		set paper offset to 0
		set page gap to 0
		set reduce or enlarge to "100%"
		set fit in area to false
		set page position to center position
		set orientation to myOrientation
		
		-- print document settings 
		set seperation to false
		set print spreads to false
		set include blank pages to false
		set print thumbnails to false
		set back to front to false
		set page sequence to all pages
		set registration marks to centered
		set tiling to off
		
		
		
		-- print options settings 
		set flip horizontal to false
		set flip vertical to false
		set invert image to false
		set print quality to normal
		set full res rotated objects to false
		set data format to binary data
		
	end tell
	set myName to (name of document 1) as text
	set thePath to path to the desktop as text
	--display dialog thePath
	set PS_file_path to (thePath & myName & ".ps") as text
	--display dialog PS_file_path
	print front document PostScript file PS_file_path
	
	
	
	
end tell