Exporting Groups in Entourage 2004

J

Justin

I used the 'Group' function to filter a large number of e-mail
addresses WITHOUT putting them into my Address book first. Now, I find
I cannot export these e-mail addresses from inside each 'Group' folder
- is there a workaround or some other way of exporting these addresses
in eaith MBOX or comma/tab delimited formats?Thank you for your reply.
Justin
 
A

Allen Watson

I used the 'Group' function to filter a large number of e-mail
addresses WITHOUT putting them into my Address book first. Now, I find
I cannot export these e-mail addresses from inside each 'Group' folder
- is there a workaround or some other way of exporting these addresses
in eaith MBOX or comma/tab delimited formats?Thank you for your reply.
Justin

If I understand you correctly, you used a rule to "add to Group"
without actually creating a contact; is that it? So you have groups in
your address book that contain addresses for which there are no
contacts; right?

You can export a group to a text file using this Applescript, if you
paste it into Script Editor, save it in your Entourage Script Menu
Items folder, and then select it from the script menu:

tell application "Microsoft Entourage"
activate
set theGroups to name of groups
set askUser to true -- Flag to control dialog
choose from list theGroups with prompt "Choose one or more groups to
export:" with multiple selections allowed
set chosenGroups to result
end tell
set AppleScript's text item delimiters to {""}
repeat with theGroup in chosenGroups
set theGroup to theGroup as text
tell application "Microsoft Entourage"
set theUsers to (display name of content of group entries of group theGroup)
set theAddresses to (address of content of group entries of group theGroup)
set theList to ""
end tell
repeat with i from 1 to count of items of theUsers
set aName to item i of theUsers
if (count of words in aName) > 1 then
set fname to words 1 thru -2 of aName
set lname to word -1 of aName
else
set fname to ""
set lname to aName
end if
set anAddress to item i of theAddresses
set aLine to fname & tab & lname & tab & anAddress & return
set theList to theList & aLine
end repeat
set thePath to ((path to desktop) & "Address Groups List") as text
tell application "Finder"
-- activate
set fileExists to file thePath exists
end tell
set myFileRef to open for access file thePath with write permission
try
if fileExists then
if askUser then
display dialog ¬
"File 'Desktop:Address Groups List' exists. Replace, append, or
quit?" buttons {"Quit", "Append", "Replace"} ¬
default button "Append"
set theButton to button returned of result
set askUser to false
else
set theButton to "Append"
end if
if theButton is "Quit" then
return
else if theButton is "Append" then
-- Append to end of file
write "***" & theGroup & "***" & return to myFileRef starting at eof
write theList to myFileRef
write return to myFileRef
close access myFileRef
else -- replace contents
set eof of myFileRef to 0
write "***" & theGroup & "***" & return to myFileRef
write theList to myFileRef
write return to myFileRef
close access myFileRef
end if
else -- create a new file
write "***" & theGroup & "***" & return to myFileRef
write theList to myFileRef
write return to myFileRef
close access myFileRef
set askUser to false
end if
on error theErr
close access myFileRef
display dialog theErr
end try
-- end tell
tell application "Microsoft Entourage" to activate
end repeat
display dialog "Group listing saved in file on Desktop:Address Groups List"
 
Top