Setting 'me' card in addressbook

I have an applescript that manipulates entries in user’s address book’s. All that is working fine but I have one refinement I want to add. That is, when the script replaces the user’s own card, it is no longer recognized as the ‘me’ card. How do I set a specific card to be the ‘me’ card from my script? TIA.


from the dictionary of Address Book:

my card get/set person Returns my Address Book card.

tell application "Address Book"
	set my card to person "myPerson"
end tell

Thanks. I’ll give it a try.

I am not having any luck getting this to work. I guess I don’t know what “myPerson” is supposed to be. What I have are variables that contain the first and last name of the person so perhaps it is my syntax that is the problem:

set my card to person item 1 of nameparts & " " & item 2 of nameparts

my card must be a reference to one unique person.
You can filter the person with a whose construction

tell application "Address Book"
set my card to 1st person whose first name is tem 1 of nameparts and last name is item 2 of nameparts
end tell

Thanks. That worked. I should have known that in applescript it was not as simple as I thought. :confused: