Re: help - its so close...
Re: help - its so close...
- Subject: Re: help - its so close...
- From: Mr Tea <email@hidden>
- Date: Fri, 14 Sep 2001 11:47:19 +0100
This from Andrew Simpson - dated 14/9/01 12.35 am:
>
some one posted some code to help out with the delay until the current
>
action is complete stuff, but i can't get it to work.
Hi, Andrew. I think you may be getting your timeouts and delays in a tangle.
A timeout (unlike its sporting namesake) does not cause a delay. Instead, it
sets the amount of time that applescript will spend waiting for something to
finish happening before displaying an 'apple event timed out' message.
To get some breathing space into your script, you could use the delay
command instead. The line 'delay 5' would make the script pause for 5
seconds before continuing. Also, AppleScript understands the terms
'minutes', 'hours', 'days', etc., so you can write '5 * minutes' instead of
'5 * 60 seconds'.
A delay is a fairly blunt tool, though. Inside your repeat loop, you may
want to look at ways of having the script check that certain conditions are
met before moving onto the next iteration.
Using a 'try' block shouldn't cause problems. The basic 'try' block allows a
script to quit gracefully & silently when something goes awry. If you want
to get some idea of what went wrong, you can snag the error in a variable
and display it to give you at least a minimal level of feedback.
try
--script
on error errmsg
display dialog errmsg
end try
HTH
Mr Tea
--
Brew of the day: Lapsang Souchong
Visit the Tea Room at:
http://homepage.mac.com/mrtea/tearoom.html