Make the OS X Address Book Search Google Maps

Make the OS X Address Book Search Google Maps 1“Mapquest is an aging mapping system and doesn’t fit in with the new shinyness in Tiger. Thats why I made the phone book widget use Google Maps instead.” [Via macosxhints.com]

In with the new.

No matter how many times I go, I can’t remember where Louis’ Cleaners is. I know they’re on Bergenline Ave., but can never remember where. I use the phonebook widget constantly only for this crucial information.

MapQuest is the Internet Explorer of mapping sites – it had its day in the sun and still is the quite possibly the most well known but is, feature wise, drooping like a soggy dieaper that leaks.

This modification to your Mac OS X Dashboard Phonebook widget will allow you to search on google maps instead of mapquest and thus get all the satellite data and rich display options that Google maps gives you….


Here’s a quick rundown of what to do:

1. In the Finder, go to /Library/Widgets

2. Control-click on Phone Book.wdgt, and choose Show Package Contents from the pop-up menu

3. Duplicate PhoneBook.js so that you have a back up — just in case.

4. Open PhoneBook.js in your favorite Text Editor (I used BBEdit).

5. Find the following block, which begins on line 802:

var mapURL = “https://www.mapquest.com/maps/map.adp?country=us&address=”;

mapURL += URLEncode( singleResult.address );
mapURL += “&city=”;
mapURL += URLEncode( singleResult.city );
mapURL += “&state=”;
mapURL += URLEncode( singleResult.state );
mapURL += “&zip=”;
mapURL += URLEncode( singleResult.zip );

6. Replace that block with the following block:

var mapURL = “http://maps.google.com/maps?q=”;

mapURL += URLEncode( singleResult.address );
mapURL += “+”;
mapURL += URLEncode( singleResult.zip );
mapURL += “&hl=en”;

7. Save changes to the file and quit the editor.