# Add to Existing Contact from Mail.app to Contacts.app

I am looking for an option to add the choice "Add to Existing Contact" from the Apple Mail.app From address field. As you all know, we have "Copy Address, Add to VIPs, New Email, Add to Contacts, and Services" as current choices. I am hoping that I can find a way to have an additional choice of "Add to Existing Contact" to this list - maybe listed under Services.

I know that this is a choice when you use the smart detection feature from a signature. I also know this is an option in iOS 6. So how can I get the same functionality for From: addresses in Mail.app?

-

This is a quick look at this,. which means it can either be refined or there is a better answer.

I will assume you know how to create an automator service. So here is an image showing the setup.

Run Applescript 1, code: on run {input, parameters}

    set bigList to {}
tell application "Contacts"

repeat with i from 1 to number of items in input
set this_item to item i of input
copy name of this_item to end of bigList
end repeat
end tell
return bigList
end run


Run Applescript 2, code:

on run {input, parameters}
tell application "Mail"
set eachMessage to item 1 of (get selection)
end tell
tell application "Contacts"
set thisPerson to first person whose name is item 1 of input

make new email at end of emails of thisPerson with properties {label:"home", value:theExtractAddress}
save
end tell

end run


It will ask for permission to access the Addressbook the first time you run it. And is a bit slow to return the search results. but worked in my test.

-
I do know how to do an automator service. Thanks so much for your help. I will try right away and let you know if it works. THANKS! –  FolsomFan Apr 19 '13 at 21:48
It worked! This is wonderful. Thank you. Do you know of a way I can assign a keyboard combo to activate this script? –  FolsomFan Apr 19 '13 at 22:03
read this apple tech note on how support.apple.com/kb/PH3957 –  markhunte Apr 20 '13 at 0:36