I found this code on this site and was elated to see that it could do a tedious task that I have to do weekly, namely which is to make a whole series of pdf files from quark documents from various sized documents.
I wanted to create a script that opens the file, gets the document size, sets the print set up paper size to the width and height of the document, and spits out a post script file to a specific folder on my hard drive.
This is almost what I need, and I believe I owe a debt of gratitude to PR9000 for getting me this far.
I’ve tried to run it, but it snags inseveral spots, namely
set paper width to newPaperWidth,
where it tells me I can’t do this
I’m a real newbie and would be grateful to anyone for their time and vast knowledge in solving this problem for me.
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