I have written a small Applescript plug-in for Address Book that finds the address of the selected person in Route 66. Depending on the version of Route 66 you have, you'll need to edit the property _version and property _subversion values in the script.

Hint Options

Click here to return to the 'An Address Book plug-in to find addresses in Route66' hint

The following comments are owned by whoever posted them. This site is not responsible for what they say.

Anyone Get This To Work?
Authored by: pxlated on Jan 19, '05 02:51:22PM

Followed the instructions and do have the "GoogleMe" script referenced working and the "System Events" are enabled.
It opens Route66 but gets to the "subversion" and throws the "ERROR - GUI scripting enabled?" message.
In the provided script, it lists the subversion as "R2004_1.dat" tried that and get the error. In the finder, that file on my system is listed as "R2004_1.dat.app" so tried that and it's still a no go, get the error.
Any ideas?

Hi sorry that I've seen the posts just wright now, I'm no AppleScript Guru.
My Version of Route66 launches a second app and I just got it to work when I use the second one. If someone rewrites it or adds functionality to the script your free to do so but please post all changes to the board that everyone can benefit from them.
Thnx in advance and I hope it's a little usefull ;-)
(sorry for my bad english)

I think it's great. I tried to make a similar script a month or two ago and failed miserably. I plan to look through some AppleScript tutorials and see if I can make it work with apartment numbers in the address (by stripping them from the query).

I updated the script to strip apartment numbers from the address field. This only works if you list apartment and suite numbers as 123 street #7 and not 123 street apartment 7.
I also changed it to format the query as street, city, state, zip instead of street zip city. Route 66 seems to work fine with either formatting, it was just a personal preference.

property _version : "ROUTE 66 Route 2004"
property _subversion : "ROUTE 66 Route 2004"
using terms from application "Address Book"
on action property
return "address"
end action property
on action title for _person with _address
return "Find Address in Route66"
end action title
on should enable action for _person with _address
return true
end should enable action
on perform action for _person with _address
set theresult to my getaddress_of_selection() as list
if item 1 of theresult is {} and item 2 of theresult is {} and item 3 of theresult is {} and item 4 of theresult is {} then
display dialog "\"No Address entry found\"" buttons {"OK"} default button 1 with icon 2
else
set addr to item 1 of theresult & ", " & item 2 of theresult & ", " & item 3 of theresult & ", " & item 4 of theresult as string
try
tell application _version to activate
end try
tell application "System Events"
repeat 20 times
if application process _subversion exists then
exit repeat
end if
end repeat
end tell
try
tell application _subversion to activate
tell application "System Events"
tell application process _subversion
set value of combo box 1 of tab group 1 of splitter group 1 of splitter group 2 of window 1 to addr
delay 0.5
click button 2 of tab group 1 of splitter group 1 of splitter group 2 of window 1
end tell
end tell
on error
display dialog "ERROR - GUI scripting enabled?" with icon 2
end try
end if
end perform action
end using terms from
on getaddress_of_selection()
tell application "Address Book"
set sellist to selection
set oneentry to item 1 of sellist
set oneentry to id of oneentry
set str to street of address of person id oneentry as string
set thezip to zip of address of person id oneentry
set cit to city of address of person id oneentry
set sta to state of address of person id oneentry
end tell
if str is {missing value} then
set str to "" as string
else
repeat with Num from 1 to length of str by 1
if get character Num of str is equal to "#" then
set str to (get text 1 through (Num - 2) of str)
display dialog "Apartment Number was stripped" with icon 2
exit repeat
end if
end repeat
end if
if thezip is {missing value} then set thezip to "" as string
if cit is {missing value} then set cit to "" as string
if sta is {missing value} then set sta to "" as string
return {str, cit, sta, thezip}
end getaddress_of_selection

i 'm trying to improve this super script a bit by trying to get the street number and name with this language

set savedTextItemDelimiters to AppleScript's text item delimiters
try
set street_address to (street of _address) as string
set AppleScript's text item delimiters to {","}
set number_and_street to first text item of street_address
--reset the text item delimiters:
set AppleScript's text item delimiters to savedTextItemDelimiters
on error
--also reset text item delimiters in case of an error:
set AppleScript's text item delimiters to savedTextItemDelimiters
beep
end try

but i'm burned out and cannot get it to work
(it should grab whatever comes before the first comma, which should be the street number and the street name before the apartment number or suite number)