Re: How to react to browser window-name
Re: How to react to browser window-name
- Subject: Re: How to react to browser window-name
- From: Matthew Smith <email@hidden>
- Date: Fri, 02 Nov 2001 13:33:07 +1100
on 02/11/01 12:35, email@hidden at email@hidden wrote:
>
I need to write an AppleScript that checks the name of the browserwindow
>
every .5 seconds and quits the browser if the windowname = "quitme".
>
>
I'm trying to give myself a crash course in AppleScript syntax (I come from a
>
Macromedia Director background). Could someone help me with my syntax?
>
Logic tells me it should look something like this:
>
>
repeat forever
>
tell application "Internet Explorer"
>
if GetWindowInfo = "quitme" then
>
quit
>
exit repeat
>
end if
>
end tell
>
delay .5
>
end repeat
>
The parameter to delay is an integer stating the number of seconds for the
delay. So the minimum would be 1. Having a repeat loop happen every second
would be quite intensive. Usually a delay would be several seconds and not
in a repeat loop.
I am intrigued to know why you want to test of the browser window name and
quit if it is "quitme". It seems to be a clunky way of doing it. Is the
script meant to execute something to happen in the browser window and wait
for it to finish? Why do you actually want to quite the browser? What if
there is more than one browser window? Should you be using JavaScript in the
browser instead?
--
Matthew Smith