• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Detect an URL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Detect an URL
      • From: Bill Cheeseman <email@hidden>
    • Re: Detect an URL
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Re: Read File Problems
  • Next by Date: Re: Detect an URL
  • Previous by thread: Re: Detect an URL
  • Next by thread: Re: Detect an URL
  • Index(es):
    • Date
    • Thread