How can I get my address book to sort by surname? It sorts everything
by first name at the moment. I know you can sort by column, but the
name fields are integrated into one. Anyway, I would like to sort by
category, but still have the names sorted within those categories
according to surname. I am using Entourage X for Mac, version 10.1.1
(2418) on a G4 AGP graphics PowerMac.
The Address Book DOES sort by surname - it's impossible to get it to sort by
first name. It's just that it displays the name in 'First name Last name'
order. But it's sorted by last name. If you want it to display just the
surname, or in 'Last name, First name' order, then copy either just the Last
name, or else type 'Last name, First name' into the nickname field and then
sort by Nickname (click on Nickname column header).
To do that for all your contacts in one fell swoop, you can do it by script.
Since you only need to do this once (from now on, make sure to fill in the
nickname of new contacts when you make them) you can just do it form Script
Editor. The super-simple method:
tell application "Microsoft Entourage"
set allContacts to every contact
repeat with i from 1 to (count allContacts)
set theContact to item i of allContacts
set nickname of theContact to (get last name of theContact)
end repeat
display dialog "All done!"
end tell
would leave you with blank fields when a contact doesn't have a last name.
Here's a more elaborate script that does the 'Last name, First name' thing
when a contact has both, or just last or first when it has just one or the
other, or company when it has neither, or email address when it has none of
the above. (Past that point, it stays blank!)
tell application "Microsoft Entourage"
set allContacts to every contact
repeat with i from 1 to (count allContacts)
set theContact to item i of allContacts
tell theContact
set {lName, fName} to {last name, first name}
if lName ‚ "" and fName ‚ "" then
set nickname to (lName & ", " & fName)
else if fName ‚ "" or lName ‚ "" then
set nickname to (lName & fName)
else if company ‚ "" then
set nickname to (get company)
else if every email address of it ‚ {} then
set nickname to default email address
end if
end tell
end repeat
beep 2
display dialog "All done!"
end tell
Now add the Nickname column in View/Columns, and click on the Nickname
column header. You can also drag the Nickname column header to the far left
if you wish. There you are.
--
Paul Berkowitz
MVP Entourage
Entourage FAQ Page:
http://www.entourage.mvps.org/toc.html
Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.
PLEASE always state which version of Entourage you are using - 2001 or X.
It's often impossible to answer your questions otherwise.