QuarkXPress - EPS each document and close

After much fiddling I finally got a script to work that will take each open Quark document, EPS it and close it. There wasn’t a whole lot available as far as troubleshooting goes out there for “save as EPS” scripts in Quark. I thought I’d share what I learned so anyone else can use it as a base for the same type of action. I will work more on it later to get it to be universal instead of specific to my machine. The real keys to getting it to work seemed to be in making sure to tell Quark the full filepath and filename. If I tried to combine variables in the “save” line, it would fail, but if I defined everything before the save line, it would work.

And now… I go home.

tell application "Finder" to set FilePath to "2074:Users:admin:Desktop:EPS Ads:" as string
	tell application "QuarkXPress"
			tell document 1
				set bounds to {22, 32, 916, 1180}
				set DocName to name as text
				set FullPath to FilePath & DocName & ".eps"
				save page 1 in FullPath EPS format Mac color EPS data ASCII EPS scale 100 with transparent page and include preview
				close with saving
			end tell
		end repeat
	end tell
end try

Model: PowerMac G5 DP 2.0
Browser: Firefox 3.6.8
Operating System: Mac OS X (10.4)