Title: Re: Combining address book items
On 12/10/00 10:54, Gilbert Harman wrote:
> I have imported email addresses from Outlook Express as well as addresses
> with phone numbers from Now Contact. So often I have the two items for a
> person, one with email address, the other with mailing addresses and phone
> numbers. I started combining these by adding email addresses to the items
> with mailing addresses and then deleting the original items with the email
> addresses. Unfortunately, that also deleted these items from groups they
> might be in.
>
> I could manually go the other direction, copying the information about
> mailing addresses to the items with the email addresss, and then deleting
> the original items with the mailing addresses. However, that's a lot more
> copying and increased chance of error.
>
> Is there an easier way to combine these items without deleting email
> addresses in groups?
It can be done with AppleScript, but it might not be exactly fast (although probably still faster than doing it all by hand <G>).
The script below makes a few assumptions, which may or may not be true:
(1) There are never more than two duplicates
(2) The duplicates all have the exact same name
(3) Only one of the contacts has an email address; the other has no email address, but does have postal address and telephone.
(4) The contact with the email address does not have any address/telephone information (or at least none that you’d mind swapping with the duplicate).
(5) You want the contact who did NOT have an email address to be deleted after the address and telephone information is transferred to the contact who DID have an email address.
If any of those do not apply, then this won’t work. But if all of them are true, then this should do it for you.
tell application "Microsoft Entourage"
set contactlist to every contact
repeat with thecontact in contactlist
try
set findname to name of thecontact
set duplist to (every contact whose name is findname)
if (count of duplist) is 2 then
repeat with i from 1 to 2
set dupcontact to item i of duplist
set haveEmail to ""
try
set haveEmail to default email address of dupcontact
end try
if haveEmail is not "" then
if i is 1 then
set othercontact to item 2 of duplist
else
set othercontact to item 1 of duplist
end if
set home address of dupcontact to home address of othercontact
set business address of dupcontact to business address of othercontact
set home phone number of dupcontact to home phone number of othercontact
set business phone number of dupcontact to business phone number of othercontact
delete othercontact
end if
end repeat
end if
end try
end repeat
end tell
--
George Clark - [EMAIL PROTECTED]
- Combining address book items Gilbert Harman
- Re: Combining address book items George Clark
- Re: Combining address book items Gilbert Harman
