switch Quark frontmost doc

I have a script that will print all open Quark files, but I get an error, saying Quark can only print the frontmost document.
This is currently a very simple script. However I do expect it to get more complicated, as it is Quark. I am doing the same thing in InDesign, and it is effortless.

tell application "QuarkXPress"
	activate
	set theseDocs to the name of every document
	repeat with n from 1 to count of theseDocs
		set ThisDoc to item n of theseDocs
		--bring window of document ThisDoc to the front I need here
		print
	end repeat
	end tell

How do I get the other open documents to become the frontmost when it is their turn?

Thanks!

Tim

Model: 2 GHz Dual G5, 4.5Gb RAM
AppleScript: 1.10.7
Browser: Safari 419.3
Operating System: Mac OS X (10.4)

Hi Tim,

I don’t have Quark, in Indesign you can switch documents by settng the active document property
for example

tell application "Adobe InDesign CS3"
	if (count documents) > 1 then set active document to last document
end tell

Quark will “show” you objects if your object is document then it will become document 1 the front one. It’s rather unintuitive I must admit but works.

tell application "QuarkXPress"
	activate
	set theseDocs to the name of every document
	repeat with n from 1 to count of theseDocs
		set ThisDoc to item n of theseDocs
		show document ThisDoc
		tell document 1
			print
		end tell
	end repeat
end tell

Thanks for the help, Mark. That little command did the trick.
I do find Quark’s AppleScript dictionary is getting behind InDesign in depth.
Also, the syntax of commands is definitely less intuitive.

Model: 2 GHz Dual G5, 4.5Gb RAM
AppleScript: 1.10.7
Browser: Safari 419.3
Operating System: Mac OS X (10.4)

I know what you mean in quark active only applies to layout space within project and foremost to the app itself. Show is not the most obvious of routes. Glad it worked out anyhow.