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: email@hidden
- Date: Thu, 1 Nov 2001 21:48:27 EST
The goal is to have a button on a web-page that quits the browser. It's for
an ISP, and they wanted it so that after the user registers for their DSL
connection, the browser quits and they are prompted to enter their own DSL
login info and then the connection is re-instated. I couldn't think of any
other way to do this - - Javascript can't quit the browser, so AppleScript
seems the next best way. It's working out quite well, thanks to the advice
of folks on this listserve. AppleScript rocks!
- Rob
In a message dated 11/1/01 9:42:39 PM, email@hidden writes:
<< 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
_______________________________________________
applescript-users mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/applescript-users
----------------------- Headers --------------------------------
Return-Path: <email@hidden>