Re: Detect an URL
Re: Detect an URL
- Subject: Re: Detect an URL
- From: Cal <email@hidden>
- Date: Tue, 20 Mar 2001 01:48:17 -0500
Paul Berkowitz <email@hidden> wrote:
> on idle
tell application "Internet Explorer"
set winList to ListWindows
set info to GetWindowInfo (item 1 of winList)
set theURL to item 1 of info
if theURL = "http://www.google.com/" then
tell me to display dialog "you are in google"
else
tell me to display dialog theURL as string
end if
end tell
> end idle
I don't use idle handlers much, but I think that that's missing a 'return'
statement, saying how often it should be run? One reason why Nuria's
original script wasn't doing what she hoped was that - although it 'stays
open' - it only ran once, when first double-clicked. Probably she'd like it
to run every few seconds or every second, So, just above the 'end idle' line
at the bottom, I think it needs
return 1 -- or return 5
Not true. (Sorry again, Paul.) The above idle handler will execute
every 30 seconds by default, as if there were a "return 30" as the
last command of the handler.
on idle
beep
end idle
There's no return in this, and it will beep every 30 seconds.
Cal