timeout block question
timeout block question
- Subject: timeout block question
- From: Jim Brandt <email@hidden>
- Date: Wed, 18 Mar 2009 11:17:22 -0500
I have a question about timeout blocks.
I currently have a script that logs into a web page (a secure page),
makes some selections from that page to navigate to a different
page within this site and prints this page to a pdf file. This
requires some
GUI scripting as the page is not static. Even with delays and
attempts to
verify that the pages are completely loaded before moving to the next
page, this script sometimes hangs. This usually happens when the site
doesn't respond in a timely enough manner.
This script is triggered via cron at 7 pm every day. It tends to fail
about
once a week.
Since this script is self-contained, I would like to run it from a
second
script, within a timeout block, that would limit the first script to,
say, 3
minutes; something like this:
with timeout of 180 seconds
run script alias "hd1:script source:myscript.scpt"
end timeout
This way, I can test for the existence of the pdf file, and if it
wasn't created,
cycle through the process again until it completes. But to do that, I
need the
timeout block to fail after a certain amount of time, indicating that
the
called script "hung".
To test this, I changed the time from 180 to 10 seconds. The 10 seconds
passed but the first script continued to run, and when it was done,
returned
to the calling script without an error, even though it took more than 10
seconds (it took more like a minute and a half to run). This implies
to me
that the timeout was not honored.
Am I missing something here? Can a timeout block be used in this manner,
and if so, what do I need to change?
TIA,
Jim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden