An iChat paging AppleScript

May 22, '05 03:56:00PM

Contributed by: Anonymous

I wanted a way to know when certain people sent me an instant message when I was away from the computer. I came up with the following simple AppleScript to do just that.

The script (when saved as Stay Open) runs at idle time and checks iChat for a window of a specific title. iChat creates windows named "Chat with John Doe" where "John Doe" is the name as used in your Address Book/Buddy List. When a window appears with the proper name, and a "page" in my case hasn't already been sent, a page is sent as appropriate. Obviously this hint can be expanded, but this served an immediate need and works great!

on idle
  tell application "iChat"
    if (exists window "Chat with John Doe") and ¬
    (not (exists window "Chat with +12125551212")) then
      send "IM waiting from John Doe" ¬
      to account id "AIM:+12125551212"
    end if
  end tell
  return 10 -- repeat every x seconds
end idle
[robg adds: I haven't tested this one...]

Comments (11)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20050510174759663