How to sort names in Address Book

S

skb

The address book sorts my name column by the first name then last e.g.
Jim Brown or Mary Smith. I want to sort it Brown, Jim; Smith, Mary The
only option I see for the column sorting is bottom of the list, top of
the list. Surely this is a simple issue. I appreciate your
consideration--. Thanks. Sara
 
B

Barry Wainwright

The address book sorts my name column by the first name then last e.g.
Jim Brown or Mary Smith. I want to sort it Brown, Jim; Smith, Mary The
only option I see for the column sorting is bottom of the list, top of
the list. Surely this is a simple issue. I appreciate your
consideration--. Thanks. Sara

It does actually sort by last name, it just displays first name, last name.

You can't change the display order of the name field, but if you runb this
script:

tell application "Microsoft Entourage"
set theMessages to every contact whose custom field eight is ""
repeat with aMessage in theMessages
tell aMessage
if last name is "" then
set custom field eight to first name
else
set custom field eight to last name & ", " & first name
end if
end tell
end repeat
end tell



Then set the address book to display custom field 8 (control-click in the
column headers and select the field), you can view and sort on this column.
 
B

Barry Wainwright

It does actually sort by last name, it just displays first name, last name.

You can't change the display order of the name field, but if you runb this
script:

tell application "Microsoft Entourage"
set theMessages to every contact whose custom field eight is ""
repeat with aMessage in theMessages
tell aMessage
if last name is "" then
set custom field eight to first name
else
set custom field eight to last name & ", " & first name
end if
end tell
end repeat
end tell



Then set the address book to display custom field 8 (control-click in the
column headers and select the field), you can view and sort on this column.

On testing, it seems there may be a problem with contacts that have no last
name - here's an improved version:

tell application "Microsoft Entourage"
set theContacts to every contact whose custom field eight is ""
repeat with aContact in theContacts
tell aContact
if last name is "" then
copy first name as string to custom field eight
else
set custom field eight to last name & ", " & first name
end if
end tell
end repeat
end tell
 
S

skb

Barry,
Unless I can snag the neighborhood 14 year old computer wiz I am afraid
this is over my head. I don't have a clue how to "tell application
'Microsoft Entourage' anything." I appreciate your efforts and if I do
find that kid, I'm sure it will make perfect sense to her.

I'll get use to the first name last name display--maybe.

Sara
 
B

Barry Wainwright

Barry,
Unless I can snag the neighborhood 14 year old computer wiz I am afraid
this is over my head. I don't have a clue how to "tell application
'Microsoft Entourage' anything." I appreciate your efforts and if I do
find that kid, I'm sure it will make perfect sense to her.

I'll get use to the first name last name display--maybe.

Sara

1. Select the script in the previous message window,
2. open the application 'Script Editor' (/Applications/Applescript/Script
Editor.app)
3. paste the script into a new window

If you are connected on-line while reading this message, clicking this URL
should accomplish steps 1-3 for you :)
http://tinyurl.com/8g7jk

4. hit the 'run' button
5. For future use, save the script (set the 'file format' pop up in the
save dialog to 'script') in the folder ~/Documents/Microsoft User
Data/Entourage Script Menu Items/ (where ~ is your home directory)

The script will now be available to run from Entourage's script menu (the
black 'scroll' icon to the right of the Help menu) whenever you have added
new contacts and want to update the custom field entries for those items.

The first run of the script may take a few minutes if you have a lot of
contacts. Subsequent runs should be quicker as the script selects only those
entries which are blank to start with.
 
Top