A Google personal lookup plug-in for Address Book

Dec 16, '04 09:29:00AM

Contributed by: davegolden

After reading through several applescript based plug ins for the address book I decided to try some of my own and thought I would share this one. It attaches a "Google Me" option to the phone number of an individual, and does a google search on their name.

To use this, open Script Editor (in Applications -> AppleScript), copy the text of the script in, and save it with a fitting name ("GoogleThem") in the "Library -> Address Book Plug-Ins" folder under your home directory. Save it with a File Format of "Script."

 -- This script adds a menu to the phone number
-- to do a google search on the users name 
using terms from application "Address Book"
  
  on action property
    return "phone"
  end action property
  
  on action title for thePerson with LastName
    return "Google Me"
  end action title
  
  on should enable action for thePerson with Lname
    return true
  end should enable action
  
  on perform action for thePerson with fone
    
      set theURL to "http://www.google.com/search?q=" & name of thePerson
    
    tell application "Safari"
      if (count of documents) is 0 then
        make new document
      end if
      set URL of first document to theURL
      activate
    end tell
    return true
    
  end perform action
end using terms from
To use it, launch AddressBook, select an individual, and then control-click on their phone number and select GoogleThem (or whatever you named the script).

Comments (9)


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