-- Features: -- I usually put addresses of apartment dwellers into the -- "Street" field of Address Book, with the street address, -- then a return, then the apartment number. The script removes -- the apartment number (and all text after the linefeed), -- since that screws up Google Maps. -- If you don't have the zip code, but do have the city and state, -- it'll still work (and the zip code is returned with the map from Google). -- I use Firefox. If you don't, change the call to Firefox to Safari or the -- browser of your choice. using terms from application "Address Book" on action property return "address" end action property on action title for aPerson with anAddress return "Google Maps" end action title on should enable action for aPerson with anAddress return true end should enable action on perform action for aPerson with anAddress my showMap(street of anAddress, zip of anAddress, city of anAddress, Â state of anAddress, country code of anAddress) end perform action end using terms from on showMap(street, zip, city, state) try if zip is missing value then set getStr to replaceSpace(street) & "%20" & replaceSpace(city) & "%20" & state else set getStr to replaceSpace(street) & "%20" & zip end if tell application "Firefox" activate Get URL "http://maps.google.com/maps?q=" & getStr end tell on error error_message display dialog error_message buttons {"OK"} default button 1 end try end showMap on replaceSpace(itemName) set returnChar to (ASCII character 10) if itemName contains returnChar then set AppleScript's text item delimiters to returnChar set itemName to itemName's text items set itemName to (the first item of itemName as string) end if if itemName contains " " then set AppleScript's text item delimiters to {" "} set itemName to itemName's text items set AppleScript's text item delimiters to {"%20"} set itemName to (itemName as string) end if set itemName to (itemName as string) end replaceSpace