How to just grab email addresses?

P

Pitch

I need to export ONLY the email addresses of everyone in a Custom View
(about 1600) and export them into a text doc separated only by a comma.

Is there a script or method out there that will do that?

I'm working in Entourage 2004.
 
P

Paul Berkowitz

I need to export ONLY the email addresses of everyone in a Custom View
(about 1600) and export them into a text doc separated only by a comma.

Is there a script or method out there that will do that?

I'm working in Entourage 2004.

If you can accept "Full Name <[email protected]>", separated by
commas, then do this:

In the Custom View, select a contact, press cmd-A to select All.

Click "Add Group" button in the toolbar. Name the group, Save and close.

In the Address Book, select the new group. Do NOT open it. Press cmd-C
(Copy).

In TextEdit or any text window anywhere, cmd-V (Paste).

Done.

(If you prefer to have the items separated by line endings, then instead of
copy-paste, just drag the group to the text window and drop.)


To get ONLY the default email address, you'd have to do it by script:

-------------------

set newFile to choose file name with prompt "Enter a name and location for
the text file:" default name "Email addresses.txt" default location (path to
desktop)
tell application "Microsoft Entourage"
set theContacts to (get the selection)
set eAddresses to {}
repeat with theContact in theContacts
try
set end of eAddresses to default email address of theContact
end try
end repeat
set AppleScript's text item delimiters to {","}
set eAddresses to eAddresses as string
set AppleScript's text item delimiters to {""}
end tell

try
close access newFile
end try
set f to open for access newFile with write permission
set eof f to 0
write eAddresses to f
close access f

tell application "TextEdit"
open newFile
activate
end tell

------------------------------------



If what you really meant was that you wanted the email addresses separated
by a comma and a space (, ) then add a following space in this line:

set AppleScript's text item delimiters to {","}

to read:

set AppleScript's text item delimiters to {", "}


If you don't want to open the file, remove the last 4 lines of the script.
You can also change the default name of the file in the first line.


--
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.
 
G

Guest

If you can accept "Full Name <[email protected]>", separated by commas,
then do this:

In the Custom View, select a contact, press cmd-A to select All.

Click "Add Group" button in the toolbar. Name the group, Save and close.

In the Address Book, select the new group. Do NOT open it. Press cmd-C (Copy).

In TextEdit or any text window anywhere, cmd-V (Paste).

Done.

(If you prefer to have the items separated by line endings, then instead of
copy-paste, just drag the group to the text window and drop.)


To get ONLY the default email address, you'd have to do it by script:

-------------------

set newFile to choose file name with prompt "Enter a name and location for the
text file:" default name "Email addresses.txt" default location (path to
desktop)
tell application "Microsoft Entourage"
set theContacts to (get the selection)
set eAddresses to {}
repeat with theContact in theContacts
try
set end of eAddresses to default email address of theContact
end try
end repeat
set AppleScript's text item delimiters to {","}
set eAddresses to eAddresses as string
set AppleScript's text item delimiters to {""}
end tell

try
close access newFile
end try
set f to open for access newFile with write permission
set eof f to 0
write eAddresses to f
close access f

tell application "TextEdit"
open newFile
activate
end tell

------------------------------------



If what you really meant was that you wanted the email addresses separated by
a comma and a space (, ) then add a following space in this line:

set AppleScript's text item delimiters to {","}

to read:

set AppleScript's text item delimiters to {", "}


If you don't want to open the file, remove the last 4 lines of the script. You
can also change the default name of the file in the first line.

Is there a script that can find email addresses in the body of messages?
 
P

Paul Berkowitz

Is there a script that can find email addresses in the body of messages?


After all that effort, that's all you have to say?

--
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.
 
Top