Re: Entourage: Move Work Address to Home Address
Re: Entourage: Move Work Address to Home Address
- Subject: Re: Entourage: Move Work Address to Home Address
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 24 Dec 2002 12:42:07 -0800
On 12/24/02 12:24 PM, "Keith Russo" <email@hidden> wrote:
>
Anyone hacking on Christmas Eve? He he...
>
>
All my Contacts Address in Entourage X are listed as 3Work2. Now that I9m
>
going to Sync with a PDA & Cell Phone I like to move the Addresses to 3Home2
>
(for selected/highlighted contacts).
>
>
tell application "Microsoft Entourage"
>
set bAddress to business address of selection
>
end tell
>
>
The problem I9m having is getting the 3business address2 of the currently
>
selected contact. Script Editor balks "Can't get business address of
>
selection". Yet if I try
>
>
tell application "Microsoft Entourage"
>
selection
>
end tell
>
>
Results
>
>
{contact id 113 of application "Microsoft Entourage"}
Have you noticed the {list brackets}?
Selection is a list. You can't get business address of a list. You need to
get item 1 of selection, or iterate through each item of selection. I think
you want this:
tell application "Microsoft Entourage"
set theItems to selection
repeat with theItem in the theItems
if class of theItem is contact then
set StartAddress to the home address of theItem
set DestinationAddress to the business address of theItem
set the home address of theItem to DestinationAddress
set the business address of theItem to StartAddress
end if
end repeat
end tell
That swaps Home and Work addresses; if home is currently blank and business
filled, you'll get the reverse. You won't lose any data if you made an
error, and if you selected a group by mistake it will just get omitted
rather than breaking the script.
A script something like this (but with an error, at least in X) was
distributed by MS with Entourage 2001. This is based on it.
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.