On or near 11/21/03 1:20 PM, Russell  Fabry at [EMAIL PROTECTED]
observed:

> X-Mailer: MIME::Lite 1.2  (F2.71; T1.001; A1.51; B2.12; Q2.03)
> Can someone tell me the Applescript syntax for adding specific recipients
> to an open message? (i.e. to have the script automatically add
> [EMAIL PROTECTED])

Assuming you are talking about a draft window, you can do it. Here's a
writeup by Paul Berkowitz that I saved some time back:

> Although Entourage and OE are implemented in
> Unicode, unless you actually need it for multilingual operations or 2-byte
> languages (in which case just use AppleScript's "as Unicode"), you can treat
> all text as text. So if you're making a draft window you can simply say:
> 
> tell application "Microsoft Entourage"
>     activate
>     set myNewMsg to make new draft window
>     set myToAddress to  "<[EMAIL PROTECTED]>"
>     set to recipients of myNewMsg to myToAddress
>     set subject of myNewMsg to myToAddress
> end tell
> 
> 
> Making outgoing messages, which can be done behind the scenes without seeing
> them at all on the screen, is somewhat trickier, particularly in view of the
> user-unfriendly (confusing) definitions of Apple's mail Text Suite followed
> by Entourage, which has two different terms 'address', one a class, and one
> a string property. You can define all necessary properties of all objects at
> inception as wellThere is an easy coercion for simple 'to recipients' like
> this:
> 
> tell application "Microsoft Entourage"
>     set myToAddress to "<[EMAIL PROTECTED]>"
>     set to recipients of myNewMsg to myToAddress
>     set subject of theMsg to myToAddress
>     set theContent to "Hello!"
>     set theMsg to make new outgoing message at drafts folder with properties
> {subject:myToAddress, content: theContent, recipient:{address:myToAddress}}
> end tell
> 
> But the proper way to to the recipient part, which is a record, and which
> you _have_ to do when either specifying a recipient type other than the
> default 'to recipient', OR when you have more than one recipient, OR when
> you want to include the display name as well as the email address, is like
> this:
> 
>         set theMsg to make new outgoing message at drafts folder with
> properties {subject:myToAddress, content:theContent,
> recipient:{{address:{address:myToAddress, display name:"John Smith"},
> recipient type:to recipient}, {address:{display name:"Mary Smith",
> address:"[EMAIL PROTECTED]"}, recipient type:cc recipient}}} -- all one line
> 
> I've used a variety of variable/straight text, etc. for you to see how it
> works. 'recipient' is a record of several addresses, each with an 'address'
> and 'recipient type' property. Each 'address' in turn is a record with
> 'address' (sorry!) and 'display name' properties, both of which can be
> treated as text (string), even though they're implemented in Unicode.
> 
> If anyone has ever wondered why more people don't do AppleScript themselves,
> I guess that's the reason! Once you get through some of these intricacies,
> it's quite fun.


-- 
Microsoft MVP for Entourage/OE/Word (MVPs are volunteers)
Allen Watson <[EMAIL PROTECTED]> Entourage FAQ site:
<http://www.entourage.mvps.org/>
AppleScripts for Outlook Express and Entourage:
 <http://members.thinkaccess.net/[EMAIL PROTECTED]/Scripts/>
Entourage Help Pages: <http://www.entourage.mvps.org/>


-- 
To unsubscribe:                     
<mailto:[EMAIL PROTECTED]>
archives:       
<http://www.mail-archive.com/entourage-talk%40lists.letterrip.com/>
old-archive:       
<http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>

Reply via email to