property _version : "ROUTE 66 Route 2004" property _subversion : "R2004_1.dat" 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 {} 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 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 set thezip to zip of address of person id oneentry set cit to city of address of person id oneentry end tell if str is {missing value} then set str to "" as string if thezip is {missing value} then set thezip to "" as string if cit is {missing value} then set cit to "" as string return {str, thezip, cit} end getaddress_of_selection