Re: how to prevent "script timeouts"?
Re: how to prevent "script timeouts"?
- Subject: Re: how to prevent "script timeouts"?
- From: "Donald S. Hall" <email@hidden>
- Date: Tue, 27 Nov 2001 23:03:21 -0700
The "end tell" of the Finder tell block is after everything else, which is
why you are getting a timeout if the user stays in IE too long. (One minute,
since you haven't specified "with timeout of x seconds".)
Why are you quitting your script if it is a stay open applet? Shouldn't it
be "staying open"? If IE isn't running, it will quit immediately. What
happens if a user restarts IE?
Also, this might be more efficient:
on idle
tell application "Finder"
set appList to name of application processes
end tell
if "Internet Explorer" is in appList then
tell application "Internet Explorer"
-- your check for quitme goes here, but don't quit the script
end tell
end if
return 2 -- run idle handler again in 2 seconds
end idle
HTH,
Don
>
I've got an "on idle" script (below) that I've compiled as a Run-Only app
>
with the "Stay Open" checkbox active. The purpose of this script is to
>
detect when the web-page the user is on contains the title "quitme", and then
>
it quits IE. The problem is that if the user stays in IE for a long time
>
without going to the "quitme" page, the AppleScript times out on it's own.
>
Is there a way I can prevent this from occurring?
>
>
>
>
on idle
>
tell application "Finder"
>
set allApps to processes
>
copy 0 to foundflag
>
repeat with anApp in allApps
>
if name of anApp is "Internet Explorer" then
>
copy 1 to foundflag
>
end if
>
end repeat
>
>
>
>
if foundflag = 1 then
>
tell application "Internet Explorer"
>
repeat with eachWindow in ListWindows
>
if "quitme" is in text item 2 of (GetWindowInfo
>
eachWindow) then
>
-- display dialog "quitme was found!!"
>
quit
>
tell me to quit
>
end if
>
end repeat
>
return 2
>
end tell
>
else
>
-- quit if IE isn't around
>
tell me to quit
>
end if
>
>
end tell
>
>
end idle
--
Donald S. Hall, Ph.D.
Apps & More Software Design, Inc.
http://www.theboss.net/appsmore
email@hidden