Script timeout by opening a QXD file (Quark document)

Hi,

what can I do if I get an timeout cause QuarkXPress is taking long to open a document. That long that the script goes timeout.

Is there anything I can do to set wait or pause until the document is open and then process any further?

Thanks in advance for any help.

Model: Mac Pro (Early 2009)
AppleScript: 2.2.1
Operating System: Mac OS X (10.7)

You can wrap code in a timeout block. The timeout of commands (events) can be changed if the default time of 60 seconds is too short (or long). Just replace the comments below with the open command.

with timeout of 3000 seconds
	-- insert commands here that takes longer than 60 seconds to complete
end timeout

Or replace the handler you’re using to open documents:

on openFile(thePath)
with timeout of 3000 seconds
   tell application "QuarkXPress" to open alias thePath with Suppress All Warnings
end timeout
end openFile

Minor correction: the default is 120 seconds.

Thanks :slight_smile:

Sorry for the late response.

I need to get it running on yesterday so I found the same solution you provided.

BIG THANKS to all for your help :slight_smile:

Here is my script snippet:


with timeout of 300 seconds
   openFile(theFile)
end timeout

That worked perfectly, as the file took about 4 minutes to open. So 5 minutes was enough for all the documents.

THANKS… great community :smiley: :smiley: