Problem with Quark versions for migrated scripts (to X)

I have a working script in OS 9 that I’d like to migrate over to OS X. I have one stumbling block. When Quark 6 tries to open a Quark 4 document, it always pops up a window saying the project needs minor repairs, and do I want to repair it. Is there any way to make Quark 6 do this automatically?

The situation is such that our Quark pages are actually maintained in a database, and the client for that is actually being issued the open statement, which it in turn passes to Quark. So, I don’t really have a clean try → open → on error path to follow in my script.

So, if it’s not possible to get Quark to bypass the repair project window, I’m wondering if there’s a way to intercept that message and deal with it somehow, even though I don’t have a Quark open statement to deal with an error return on?

If anyone has any ideas, I’m all ears.
Greg

This seems to work even with the GUI scripting option turned off. It does require 10.3 tho.

It will allow you to open any Quark doc (even those with “corruption”) and the script further actions on it. I left the “delay” lines in since they worked, but I have not tested OK documents with them removed.

  • dw -

on open_qxd(a)
	tell application "QuarkXPress 6.0"
		activate
		open a
		delay 1
		set p to (current page of document 1)
		if p = null then
			tell application "System Events"
				keystroke return
			end tell
			delay 1
		end if
	end tell
end open_qxd