Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Map Address Book addresses via Google Maps Apps
This AppleScript will add a "Google Map Of" option to the Address contextual menu in the Address Book application. It will open Firefox and map out the address on the new maps.google.com mapping service. Note that Firefox *must* be installed for this to work.

To install the script, just save it to a file named "Google Map Of.scpt" and put it in your ~/Library/Address Book Plug-Ins/ directory. Re-launch Address Book, then control-click on a U.S. address and select 'Google Map Of (Firefox)' from the pop-up menu.

[robg adds: This script worked as described for me. Firefox is required because Google Maps does not yet support Safari. Google Maps are also USA-only (for now?), so this only works for addresses in the states. If you haven't tested Google Maps yet, it's worth the time. As you can see in the image at right, they have a fairly impressive display, and the user interface is quite nice -- especially for a browser-based application, whose UIs I typically hate.

I also received a second Google Maps script, at nearly the same time, submitted by miked378. I tested it, too, and it works as well as the first. Feel free to use whichever you prefer; I've added the notes from miked378's submission as comments in his script...]
    •    
  • Currently 2.14 / 5
  You rated: 1 / 5 (7 votes cast)
 
[77,069 views]  

Map Address Book addresses via Google Maps | 49 comments | Create New Account
Click here to return to the 'Map Address Book addresses via Google Maps' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Map Address Book addresses via Google Maps
Authored by: unixjunkie on Feb 11, '05 11:10:35AM

There's a problem if the address has certain special characters, such as a "#" for an apartment number. I've updated my script to do a full urlencode to fix this problem for all special characters. You can get the updated script from my .Mac site.

I have not tested miked378's script, but it looks like it may have the same issue.



[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: herr_theoretiker on Feb 11, '05 11:26:34AM
Awesome script! The fix for special characters came just in time, too... I was just about to ask about that.

Do you think it would be possible to make the map open in a new Firefox tab, instead of a new window?

[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: miked378 on Feb 11, '05 02:47:35PM

My script has the same problem with special characters. Here's how I handle it:

Google Maps doesn't care about things like apartment numbers, business names, and other stuff in the address -- what it really wants is street addresses and zip codes (or city/state). My address book entries are formatted so that the first line is the street address, and subsequent lines contain information like apartment/suite numbers, floors, etc.

Rob moved my submission notes to be comments in the script itself -- in there, it states that my script removes everything from the address after the first line feed before building the URL to submit to Google. So presumably, you can put all the special characters you want in there, just not on the first line!

I understand if this isn't the way everybody formats their addresses -- just my $0.02.



[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: miked378 on Feb 11, '05 03:16:27PM

Quick note -- just to clarify, you can have multiple-line entries in each field of the address in Address Book. My address book entries have multi-line entries in the "Street" field (where lines after the first contain apartments, floors, etc) -- the script strips this other stuff out, and just uses whatever's in the first line of the street field.



[ Reply to This | # ]
How do I Mute Certain Applications, and not others?
Authored by: mindonlightning on Feb 24, '05 10:58:42PM

Does anyone know of a way to mute certain applicatons, while leaving others unmuted. Many times i want to be able to hear iTunes, but have , for example, Halo muted.



[ Reply to This | # ]
How do I Mute Certain Applications, and not others?
Authored by: Aet on Mar 01, '05 10:07:55AM
Sounds like you're looking for Detour. But isn't the forums the place to post questions like this, since it's pretty off topic here?

[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: NovaScotian on Feb 11, '05 11:16:48AM

Copied the script to AppleScript Editor, saved as app, put in appropriate folder, selected an address, no show. The address book contextual menu shows the MapQuest version only.



[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: unixjunkie on Feb 11, '05 11:45:32AM
Save it as a script, then copy it to the Address Book Plug-Ins folder. Or you can just d/l it from my .Mac site at http://homepage.mac.com/unixjunkie/.cv/unixjunkie/Public/Google%20Map%20Of.dmg.zip-link.zip.

[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: toor on Feb 14, '05 02:13:05AM

Kool.

I use Mozilla 1.4.1 as a backup to Safari, and just copied over unixjunkie's script, changed the calls from Firefox to Mozilla, and it works like a charm.

Thanks UJ and Google!



[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: hembeck on Feb 14, '05 12:40:58PM

I don't seem to have an Address Book Plug-Ins folder, so I created one. Dropped the script in there, and still showing the Mapquest "Map of" link in Address Book. Since i don't have a plugins folder, and it didn't work after creating one, my conclusion is that this script will only work with OS 10.3.X version of Address Book. Is this a correct assumption?

-Fernando

---
--Health, Wealth and Happiness--



[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: SeanAhern on Dec 21, '05 07:22:35AM

Your script seems to be gone from the net. Could you please post it here for safekeeping?



[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: NovaScotian on Feb 11, '05 12:01:17PM

Must be saved as Script!



[ Reply to This | # ]
speech bubble label added to spice up screen shot?
Authored by: slaterecords on Feb 11, '05 11:47:49AM

Was the speech bubble label just added to spice up screen shot? or am I missing something? I am guessing that it was just added for the screen shot.



[ Reply to This | # ]
speech bubble label added to spice up screen shot?
Authored by: googoo on Feb 11, '05 12:23:57PM

The speech bubble label is on by default when the map is displayed (but you can close it).

-Mark



[ Reply to This | # ]
speech bubble label added to spice up screen shot?
Authored by: zane on Feb 13, '05 07:38:23PM
The speech bubble seems to only appear when you enter (and Google Maps can find) a specific street address, including it's street number.

Entering '1 Infinite Loop, Cupertino, CA' does indeed yield a speech bubble, but excluding the '1' does not (although you do get little light-bulb looking icons for businesses nearby to Infinite Loop, and clicking them pops up a speech bubble)

They also appear on certain other events too, such as performing a 'Directions To/From' query. The light-bulb icons appear on the origin & destination addresses, clicking these light bulbs pops up a speech bubble.

[Double posted this comment btw, the first one ended up at root, not here... oops, sorry about that.]

[ Reply to This | # ]
Any way to replace the default "Map of" entry?
Authored by: jigu on Feb 11, '05 12:43:20PM

Is there any way to replace the default "Map of" entry in the address book with such a script. In europe, the default Mapquest link doesn't really work so I'd like to get rid of it... Any ideas?



[ Reply to This | # ]
Any way to replace the default "Map of" entry?
Authored by: pcook on Feb 13, '05 12:56:02AM

Related to this request . . . I tried the standard Mapqeust version to look for a Canadian address. Unfortunately "country=us" is inserted in the URL even though I have "Canada" entered in the Country field. So of course I get a result page with "did not match any locations". If I edit the URL so that "country=ca" the correct address is returned.

Is there a way to tweak the built-in functionality so that it respects the country field?

---
-Peter



[ Reply to This | # ]
Any way to replace the default "Map of" entry?
Authored by: bspahn on Feb 15, '05 06:24:10AM

I was very upset about this problem at first, but the solution was very... well, not obvious, but simple!

Change your address format for the particular address to the correct country. If your address is in Canada, then just click on the address tab while in Edit mode and choose "Change Address Format...>" and select "Canada". Done. Mapquest will show the correct location. I had this problem with addresses in the UK, France, Germany and wherever. Now it's sorted : )

Oh and if you don't like the way the address is presented for some of the countries you might want to look at another hint on this site which tells you how to make your own...

http://www.macosxhints.com/article.php?story=2005020113180811



[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: billbarstad on Feb 11, '05 12:46:46PM

I assume this can be modified to work with Camino, as Google Maps works for it too. I'll try it tomorrow.



[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: miked378 on Feb 11, '05 03:13:23PM
Google Maps says that it's not compatible with Camino, but I haven't really tried too hard to get around that.

I also realized that in the comments of my script, I suggested that you can just change the app that's called to the browser of your choice -- that doesn't seem to be the case, actually. In Safari -- I had to tweak the script a bit, but got it to where it could form the correct URL and submit it to Google Maps -- but you end up with the page that says Google Maps is not compatible with Safari (they're working on it). If you want to try with Safari, using my script, replace the section that says this:

tell application "Firefox" activate Get URL "http://maps.google.com/maps?q=" & getStr end tell

with this:

tell application "Safari" if (count of documents) is 0 then make new document end if set URL of first document to "http://maps.google.com/maps?q=" & getStr activate end tell

You'll get the same "not compatible with your browser" page, but you'll see the correct URL in the box. This should work for Safari as soon as Google can implement support, assuming Apple doesn't change their AppleScript dictionary for Safari before then. Good luck!

[ Reply to This | # ]

Map Address Book addresses via Google Maps
Authored by: kuginomura on Feb 11, '05 04:13:22PM

can you alter this just a bit for it to work with Camino?



[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: jaysoffian on Feb 11, '05 04:14:40PM

Actually Google Maps works fine with the latest versions of Camino, at least for me.

The problem is that I don't think that Camino is scriptable. At least, I'm getting an NSCannotCreateScriptCommandError when I try.

Oh well.



[ Reply to This | # ]
Re: Map Address Book addresses via Google Maps
Authored by: Uncle Asad on Feb 11, '05 06:51:23PM
Camino is scriptable...somewhat, and you can't read its dictionary. Based on eccoana's post in the Camino MozillaZine forum, it seems one'll need to replace any "Get URL" or "openURL" with "open location" instead. Presumably that will get these scripts working.

[ Reply to This | # ]
Re: Map Address Book addresses via Google Maps
Authored by: jaysoffian on Feb 12, '05 10:19:52AM

Yep, that did it. Works fine in Camino now.



[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: allanmarcus on Feb 11, '05 02:30:30PM

Great script. I had to change the "OpenURL" to "Get URL" and then it worked for me.

Also, here's something to try (and a little scary). Enter your phone number in a google search. It might find you and offer to display a map to your house. Scary.

-Allan



[ Reply to This | # ]
removing your phone number
Authored by: -dl- on Feb 14, '05 01:55:08PM
Other options
Authored by: wangman25 on Feb 11, '05 03:59:35PM
Actually, some of Google Maps works in Safari, and you can zoom into most North American streets.

http://maps.google.com/maps?fc=1

[ Reply to This | # ]
Google maps
Authored by: zoff on Feb 13, '05 03:10:41PM

Google maps is not working in Safari or Firefox. I only see the zoom controler. OS X 10.3.8, Safari 1.2.4, Firefox 1.0.



[ Reply to This | # ]
Google maps
Authored by: xgbcman on Feb 15, '05 04:51:12AM

I have the same versions and it works in Firefox.



[ Reply to This | # ]
Today, Google Maps now work in Safari!
Authored by: dzurn on Feb 25, '05 04:05:58PM

I just tried maps.google.com, and the whole thing worked for me! A day or so ago I got the "Can't use Safari" page, and a zoom indicator with a blank map, but now it shows a scrolling map, directions, pushpin w/bubble text, everything seems to work just like it did in Firefox!

Google is just awesome.


---
Madness takes its toll.
Please have exact change.



[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: jonahlee on Feb 11, '05 09:08:45PM

Hmm the first updated script doesn't seem to work too well for me. I do have the apartment number in the first line, so the script doesn't seem to work too well. Also it only seems to work if Firefox is closed. It doesn't seem to work when the program is already opened. Any idea why this is? It would be great if it opened in a new tab.

---
- Jonah Lee



[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: unixjunkie on Feb 12, '05 12:39:36AM

[Update 2/12/2005] This plug-in has been updated It now urlencodes all parameters, and it joins multiple address lines onto one line.

Also, if you want Firefox to open the map in a new tab you can do this by selecting Firefox > Preferences > Advanced > Tabbed Browsing > "a new tab in the most recent window".

The new update can be downloaded from here.

I'm using Firefox 1.0 and it all seems to work fine.



[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: jonahlee on Feb 14, '05 06:44:53PM

Thanks that does work better, and does open in new tabs (though I already use tabbrowser extension, and had it set to open in new tabs). Still doesn't work if I have the Apartment number in the first line, but I don't want to reformat all my addresses (at least not right now). Thanks!

---
- Jonah Lee



[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: rgmerritt on Feb 12, '05 02:18:21PM

Actually, you only need to click on the title of the address (e. g., "Work") to invoke the pulldown to select this script.



[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: davidosus on Feb 13, '05 02:26:06AM

This is one of the best free maps I've seen! And it works in Canada!

Try entering an address followed by another a few streets down - the map will slowly and smoothly scroll to the new location. It's really cool.



[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: herbs on Feb 13, '05 12:01:14PM

This script will work with Camino also but you've got to change "GetURL" to "open url" (and change all references to Firefox to Camino instead).


---
Good Luck,
Herb Schulz



[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: essdub on Feb 24, '05 10:12:01PM
If you do it this way, a script will use the default browser:
tell application "Dock" to open location theURL
where theURL is set the the URL you want to open. So the script will work whether a user's preference is set to Safari, Firefox or whatever. Of course, the web page returned needs to be compatible with the browser or it won't display properly, but that's not the script's fault. I've used this technique in my scripts for accessing the Multimap and WhereIs map services.

[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: zane on Feb 13, '05 07:35:58PM

The speech bubble seems to only appear when you enter (and Google Maps can find) a specific street address, including it's street number.

Entering '1 Infinite Loop, Cupertino, CA' does indeed yield a speech bubble, but excluding the '1' does not (although you do get little light-bulb looking icons for businesses nearby to Infinite Loop, and clicking them pops up a speech bubble)

They also appear on certain other events too, such as performing a 'Directions To/From' query. The light-bulb icons appear on the origin & destination addresses, clicking these light bulbs pops up a speech bubble.



[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: smcneely on Feb 14, '05 09:11:31PM

Works great...and actually it works for Canadian addresses as well.

---
~ I try not to say too much...someone might just realize that I don't know what the hell I'm talking about ~



[ Reply to This | # ]
Are these scripts 10.3 dependant
Authored by: wolfkin on Feb 15, '05 09:21:19AM

I've install the script as instructed (along the way I noticed some Adium ones I forgot I installed)

The google map doesn't show up. To get the context menu control click doesn't work. I just click the title "work" or "home" and i get "Map of" which launches Mapquest in my default browser (Firefox)



[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: d3ck4rd on Feb 16, '05 01:09:49AM

The script works great (10.3.7) except it appears to conflict with Copy Mailing Label, which I need so I had to disable it. Any idea why they'd conflict?



[ Reply to This | # ]
Map Address Book addresses via Google Maps using Safari
Authored by: uurf on Mar 02, '05 06:44:45PM
To make this work with Safari, change the first script so it includes this:

		try
			tell application "Safari"
				(* display dialog googleMaps & params *)
				open location googleMaps & params
				activate
			end tell
		on error
			display dialog "You must have Safari installed to use this plug-in."
		end try
enjoy!

[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: jonahlee on Mar 07, '05 09:46:27PM

How do you have multiple street lines in Address Book? As far as I can tell in the address you only get 1 street, then city, state ZIP and country. How do you get two lines in the addres?

---
- Jonah Lee



[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: jonahlee on Mar 07, '05 09:46:55PM

How do you have multiple street lines in Address Book? As far as I can tell in the address you only get 1 street, then city, state ZIP and country. How do you get two lines in the addres?

---
- Jonah Lee



[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: rubicon on Apr 21, '05 02:28:57PM

The first script in this hint doesn't work if I have two line street addresses such as:

123 Any Street
Suite 111

However, the second script from miked378 does. For compatibility with Safari, I substituted the other lines of code which are floating around.

tell application "Safari"
open location "http://maps.google.com/maps?q=" & getStr
activate

Works fine for me under 10.3.9. Google also supports a Source and Destination address which should be easy to integrate into the script, giving you full From/To maps.



[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: vocaro on Jul 22, '05 03:00:08AM
Readers should note that there is now a Google Maps Address Book plug-in available. It is easier to install than the scripts and worked much better for me.

[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: ben42 on Aug 02, '05 09:14:27PM

Worked fine, but I like this one slightly better: http://farha.com/GMAP/ It gives you one-click access to Google directions from you to the address book entry. The plugin above is more flexible but takes an extra click.

Also GMAP has an installer that drops the plugins into the correct folder for you. Saves about 20 seconds.



[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: ebernet on Jul 25, '05 07:15:02PM

I would take the script you have here, and change the "Firefox" designator to "URL Access Scripting" and "OpenURL" command to "open location". Like that you will get to view the map in your default browser. URL Access Scripting allows you to do all sorts of URL actions through whatever default application you designated for helpers, rather then specifying it in a browser specific AppleScript.



[ Reply to This | # ]
Map Address Book addresses via Google Maps
Authored by: pholmstr on Feb 18, '06 09:46:47AM
You could also just export your address book to a tab delimited format, paste the results into this tool:

http://www.batchgeocode.com/

Then you could save the results to a web page for future use, or create a google earth KML file, etc..

[ Reply to This | # ]