Paul, my misunderstanding. Basically, your suggestion is what I do now. I
was hoping for a single-step script or automator to do the same thing. Just
makes it easier than re-building the group entry by entry (I have a large
family!).
What do you mean "hoping for"? Like a self-creating script? ;-) Someone has
to write one. (And if you learned AppleScript that someone could be you.)
This is not in fact a hugely popular request in fact no one has ever asked
for this before so there's no script already in existence, if that's what
you mean. I you became adept at AppleScript you could customize things for
yourself . The trouble with scripts designed to be used by "everyone" at
large is that the scripter has to spend more than half the script supplying
umpteen options and alternative solutions, which the person scripting for
himself does not have to bother with. The script below could be much shorter
without the options.
It leaves non-contact group members (plain "Name <email address>" types with
blue dots) alone, and won't add more than one group member to the same email
address (even if you've put the same email address into more than one
contact). It does catch (add) every email address of every contact in the
group. It lets you choose between doing this for just one group (first
suggesting a selected group, or you can choose from a list of all groups) or
every group.
---------------------------
tell application "Microsoft Entourage"
display dialog "Check all groups or just one?" buttons {"Cancel", "All
Groups", "Just One"} default button 3 with icon 1
if button returned of result = "All Groups" then
set theGroups to (every group)
else
try
set theGroups to the selection
if class of theGroups ‚ list then error number 128 --catch 'on
error'
if (count theGroups) ‚ 1 or (class of item 1 of theGroups ‚
group) then error number 128 --catch 'on error'
set groupName to name of item 1 of theGroups
display dialog "Selected group \"" & groupName & "\", or choose
another group?" buttons {" Cancel ", "Choose", groupName} default button 3
with icon 1
if button returned of result = " Cancel " then
return --quit
else if button returned of result = "Choose" then
error number -128 --catch 'on error'
end if
on error
set groupNames to choose from list (name of every group) with
prompt "Which group?"
if groupNames = false then return
set theGroups to {group (item 1 of groupNames)}
end try
end if
repeat with theGroup in theGroups
set allEntries to every group entry of theGroup
set allEntryAddresses to address of content of every group entry of
theGroup
repeat with i from (count allEntries) to 1 by -1 --in case of
deleting
repeat 1 times
set theEntry to item i of allEntries
set {eAddress, dName} to {address, display name} of content
of theEntry
if eAddress = "" then exit repeat -- means it's a group
itself, skip (will catch it in its own turn as a group)
if dName ‚ "" then
try -- may be no such contact (by name) any longer
set theContact to contact dName
if {eAddress} is not in (every email address of
theContact) then
delete theEntry -- new group member will be made
with up-to-date email address
end if
on error -- no such contact by name
try
set theContact to item 1 of (find eAddress)
on error
--no such contact with this email address
either, just a Name <email address> type
exit repeat -- skip, go on to next group entry
end try
end try
else -- no name, just email address
try
set theContact to item 1 of (find eAddress)
on error
--no such contact with this email address either,
just an <email address> type
exit repeat -- skip, go on to next group entry
end try
end if
--now we're dealing with a contact
set allContactAddresses to (every email address of
theContact)
repeat with j from 1 to (count allContactAddresses)
set thisAddress to item j of allContactAddresses
if {thisAddress} is not in allEntryAddresses then
if dName ‚ "" then
set newListing to (dName & " <" & thisAddress &
">")
else
set newListing to thisAddress
end if
make new group entry at theGroup with properties
{content:newListing}
set end of allEntryAddresses to thisAddress -- no
duplicates
end if
end repeat
end repeat
end repeat
end repeat
beep
display dialog "Done!" buttons {"OK"} default button 1 with icon 1
end tell
-----------------------------
--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <
http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <
http://macscripter.net/scriptbuilders/>
Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.
PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.