2/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:
- Launch up Script Editor (Applications > AppleScript > Script Editor)
- Select New from the File menu to create a new empty script
- Copy the code listed below in-between the "--Start" and "--End" comments
- Paste this code into the blank empty script in Script Editor
- Save the script in your ~/Library/Address Book Plug-Ins/ directory and name it "Google Map Of.scpt"
- If the Address Book application is open, quit it
- Launch Address Book and select someone with a U.S. address
- Right-click or control-click on an address and select 'Google Map Of (Firefox)' from the pop-up menu
- FireFox should open up with a map
- 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
Post a Comment
FYI- it doesn't work with the Safari browser on Mac. it's about time i tried FireFox anyway. thanks guys!
If you want this script to work in Safari, change the script as follows:
- find and replace the word Firefox with the word Safari
- change the line "OpenURL googleMaps & params" to read "set URL of front document to googleMaps & params"
- if you want the map to open up in a new window rather than in the current window, insert the line "make new document" before the "set URL of..." line
- find and replace the word Firefox with the word Safari
- change the line "OpenURL googleMaps & params" to read "set URL of front document to googleMaps & params"
- if you want the map to open up in a new window rather than in the current window, insert the line "make new document" before the "set URL of..." line
This is cool, and useful at the same time. I have used the mods suggested above and changed it so that it works better for the UK:
-- Start
property googleMaps : "http://maps.google.co.uk/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 (Safari)"
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 "Safari"
make new document
set URL of front document to googleMaps & params
activate
end tell
on error
display dialog "You must have Safari installed to use this plug-in."
end try
end perform action
end using terms from
-- End
-- Start
property googleMaps : "http://maps.google.co.uk/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 (Safari)"
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 "Safari"
make new document
set URL of front document to googleMaps & params
activate
end tell
on error
display dialog "You must have Safari installed to use this plug-in."
end try
end perform action
end using terms from
-- End
These codes are really useful sometimes. I had a book from www.kevacorp.com.It contains all details of these types of codes,multimedia ,and all software programs. really useful and interesting.
eindu
eindu
another small addition to that script - to do a reverse lookup on a phone number, here's the applescript (it's made for canada, but you can substitute that url with equivalent for US or whatever other country you need - just find proper website)
using terms from application "Address Book"
on action property
return "phone"
end action property
on action title for p with v
return "Reverse Phone Lookup"
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 telephone to ""
if value of v is not missing value then set telephone to value of v
try
tell application "Firefox"
OpenURL "http://411ca.whitepages.com/1234/search/ReversePhone?phone=" & telephone
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
using terms from application "Address Book"
on action property
return "phone"
end action property
on action title for p with v
return "Reverse Phone Lookup"
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 telephone to ""
if value of v is not missing value then set telephone to value of v
try
tell application "Firefox"
OpenURL "http://411ca.whitepages.com/1234/search/ReversePhone?phone=" & telephone
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
hese codes are really useful sometimes. I had a book from www.osx86spain.com.It contains all details of these types of codes,multimedia ,and all software programs. really useful and interesting.
Post a Comment
Links to this post:


After such a high profile career spanning over 3 decades, Hasselhoff has partaken in many a cheesy photo shoot. In Hoff's defense, most of the embarrassing photos below were taken during the 1980's or in Europe. That almost provides a loose excuse for most of these photos. But many of them are still very questionable and a few actually are quite disturbing.
Framing Hanley have certainly come a long way in a very short time. First formed in 2005, the band posted demos of their songs on MySpace.com. Two years later thier debut LP, The Moment, was released August 2007. Not bad for a bunch of guys barely out of high school.
Put
on an anti-viral panty liner and let the battle between the
spoiled rich blonde bitches begin! It's Paris Hilton, heiress
to the Hilton Hotel empire vs Lacey Underall from the movie
Caddyshack.
Our interview with Ryan was just like his lyrics, honest and articulate. Ryan was very forthcoming and spoke openly about everything from his break with No Knife to his freaky cats.
When it comes to so-called heavy metal supergroups, a lot of them usually don’t last long. But for New Orleans’ Down – made up of Ex-Pantera vocalist Phil Anselmo and bassist Rex Brown, Corrosion of Conformity guitarist Pepper Keenan, Crowbar guitarist Kirk Windstein, and Eyehategod drummer Jimmy Bower – there has been something special that has kept them unified for over 15 years.

Are
you trying to eject your iPod from your computer but the "Do
Not Disconnect" won't go away? Don't worry, this is a common
problem with a fairly easy solution.

