dboettger's Blog

Posts Tagged ‘Apple

A few days ago i had some trouble with my Address Book. The firstname and the lastname of any persons were inverted. The problem began with a sync of a Sony Ericsson K610i. After this sync the firstname of a person has been written in the column lastname and the lastname has been written in the column firstname.

After a few minutes looking for a solution included in the Address Book application i thought there was no option to invert the firstname and the lastname.

I wrote a small applescript and hope if somebody will have the same problem he will be able to use my script. In my case it worked like a charm.


tell application "Address Book"
repeat with this_person in every person
set first_name to first name of this_person as string
set last_name to last name of this_person as string
if not first_name = "missing value" then
set last name of this_person to first_name
else
delete last name of this_person
end if
if not last_name = "missing value" then
set first name of this_person to last_name
else
delete first name of this_person
end if
end repeat
end tell

Advertisements

Tweets

Advertisements