dboettger's Blog

Inverted firstname and lastname in MacOSX Address Book

Posted on: November 9, 2008

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Tweets

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

Advertisements
%d bloggers like this: