When Display Name = Company Name

S

Sam Elowitch

Usually, I like the display name of a recipient to be the person's name.
However, there are certain instances in which I would prefer to type the
company name and have the appropriate e-mail (or list of e-mails) pop up
(e.g., when sending out press releases).

Does anybody have insights into this? Right now, if I type a company name
into the To: field, nothing happens.

-Sam
 
D

Dave Cortright

Usually, I like the display name of a recipient to be the person's name.
However, there are certain instances in which I would prefer to type the
company name and have the appropriate e-mail (or list of e-mails) pop up
(e.g., when sending out press releases).

Does anybody have insights into this? Right now, if I type a company name
into the To: field, nothing happens.

Put the company name for those contacts into the nickname field.
 
S

Sam Elowitch

I tried this. Not quite what I wanted. When I typed in the nickname, it
substituted the e-mail address for what I typed. What I want it to show is
the display name, or at least "display name <email>."

-Sam
 
B

Barry Wainwright

Here's a quick & dirty script that will do what you want - it will change
the first 'to recipient' to a recipient with hteir company as the display
name.

Be warned, the script does no error checking, so if you run it without a
draft window open that has just one recipient of the right sort it will
error, but hopefully it will giove you a start for developing your own
script.

If you get stuck, come back and ask again...


tell application "Microsoft Entourage"
set theRecips to to recipients of window 1
set AppleScript's text item delimiters to {"<"}
set theEmail to text item 2 of theRecips
if theEmail ends with ">" then set theEmail to text 1 thru -2 of
theEmail
set theContact to item 1 of (find theEmail)
set theCompany to company of theContact
set to recipients of window 1 to theCompany & " <" & theEmail & ">"
end tell
 
Top