Re: Detect an URL
Re: Detect an URL
- Subject: Re: Detect an URL
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 13 Mar 2001 09:03:00 -0800
On 3/13/01 5:20 AM, "Timothy Bates" <email@hidden> wrote:
>
you want something like this
>
>
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
>
>
PS: you were using words which have special meanings (like URL, and assuming
>
that a window 1 existed.
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
--
Paul Berkowitz