Timeout Function acting weird!!!
Timeout Function acting weird!!!
- Subject: Timeout Function acting weird!!!
- From: William Jamieson <email@hidden>
- Date: Wed, 21 Mar 2001 09:36:50 +1100
Hi All,
I am attempting to use the AppleScript timeout command for a variety of
applications. Yet I find that I am getting inconsistent results.
If I use the delay command between the timeout command it does not give me a
timeout error (try using the code below).
----------------------------------------------------------------------------
try
with timeout of 8 seconds
delay 10
end timeout
beep 2
on error errMsg number errNum
activate
display dialog "Error: " & errNum & " " & errMsg
end try
----------------------------------------------------------------------------
However I hold the an application open with a dialog I can generate a
timeout error (-1712) (try using the code below).
----------------------------------------------------------------------------
try
with timeout of 8 seconds
tell application "Finder"
activate
display dialog "Holding Finder Open" giving up after 10
end tell
end timeout
beep 2
on error errMsg number errNum
activate
display dialog "Error: " & errNum & " " & errMsg
end try
----------------------------------------------------------------------------
If I hold the an application open with a repeat statement I cannot generate
the timeout error (try using the code below).
----------------------------------------------------------------------------
set x to 0
try
with timeout of 1 seconds
repeat 2000000
set x to x + 1
end repeat
end timeout
beep 2
on error errMsg number errNum
activate
display dialog "Error: " & errNum & " " & errMsg
end try
----------------------------------------------------------------------------
I am currently using Mac OS 9.1 and AppleScript 1.5.5. If anyone has had
any similar experience, has solutions to these issues or just knows the
rules that apply I would be very appreciative. Thanks for your time.
Regards
William Jamieson
Systems Developer
Smart Works Systems