Sunday, February 13, 2005

Add Google Maps to Mac OS X Address Book

Just when you thought Google couldn't get any better, they launched an amazing online mapping service this week. Also newsworthy, MapQuest crapped their pants.

If you have yet to play with Google Maps, don't waste time and go check it out. The service is still in beta, so expect a few glitches and make sure you download the FireFox web browser first (even Google thinks Internet Explorer sucks!). Also please note that Google Maps currently only supports U.S. addresses.

After checking it out, I'm sure you will agree that Google Maps isn't only a great mapping tool, but it's fun to navigate and has great graphics. You will probably want to bookmark it and make it part of your normal routine. Savvy Mac OS X users may even want to integrate it into their Address Book.

Here's how:
  1. Launch up Script Editor (Applications > AppleScript > Script Editor)
  2. Select New from the File menu to create a new empty script
  3. Copy the code listed below in-between the "--Start" and "--End" comments
  4. Paste this code into the blank empty script in Script Editor
  5. Save the script in your ~/Library/Address Book Plug-Ins/ directory and name it "Google Map Of.scpt"
  6. If the Address Book application is open, quit it
  7. Launch Address Book and select someone with a U.S. address
  8. Right-click or control-click on an address and select 'Google Map Of (Firefox)' from the pop-up menu
  9. FireFox should open up with a map
  10. Enjoy

AppleScript Code from MacOSXHints.com:

-- Start
property googleMaps : "http://maps.google.com/maps?q="

using terms from application "Address Book"

on action property
return "address"
end action property

on action title for p with v
return "Google Map Of (Firefox)"
end action title

on should enable action for p with v
return true
end should enable action

on perform action for p with v
set params to ""
if street of v is not missing value then set params to params & street of v & " "
if city of v is not missing value then set params to params & city of v & " "
if state of v is not missing value then set params to params & state of v & " "
if zip of v is not missing value then set params to params & zip of v & " "
try
tell application "Firefox"
OpenURL googleMaps & params
activate
end tell
on error
display dialog "You must have Firefox installed to use this plug-in."
end try
end perform action

end using terms from
-- End








<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]