Re: Failed Attempts to BCC with Outlook
Re: Failed Attempts to BCC with Outlook
- Subject: Re: Failed Attempts to BCC with Outlook
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 30 Oct 2002 10:36:24 -0800
On 10/30/02 9:54 AM, "Daniel Rautmann" <email@hidden> wrote:
>
I have been using the following portion of an AS
>
successfully thus far:
>
>
tell application "Outlook Express"
>
make new outgoing message at folder"Outbox" with
>
properties {subject: theSubject, content:theContent,
>
recipient:emailAddress, attachment:attachmentList}
>
end tell
>
>
>
However, I wanted to change the RECIPIENT to a BCC
>
RECIPIENT, but I keep getting an error message. I was
>
using the following and slight variations (capitals,
>
no space, etc.) of this format:
>
>
tell application "Outlook Express"
>
make new outgoing message at folder"Outbox" with
>
properties {subject: theSubject, content:theContent,
>
bcc recipient:emailAddress, attachment:attachmentList}
>
end tell
>
>
Can someone tell me what I'm doing wrong?
I just finished replying to you on the AS Studio list, after first telling
you you should ask here! Here it is again. Please ask such questions here,
not AS Studio list.
'bcc recipient' is not a property of 'outgoing message', as you can see from
OE's Dictionary. 'recipient', which is really an _element_ of messages, so
that you'd normally have to make it 'at' the message after the message has
been made, is implemented as if it were a property when you make new
messages. but you have to get the syntax correct. The syntax (below), is
pretty complicated: OE adopted the apple Mail Suite terminology which
determined the rather cumbersome syntax. So the developers also implemented
an undocumented shortcut which allows you to specify just the string email
address (or display name plus email address if you do it right) for a
default TO recipient, as you were doing in the first example. But for CC or
BCC recipients, you _must_ use the proper, no-shortcut, syntax or recipient:
Class recipient: Message recipient
Plural form:
recipients
Properties:
address - address -- the recipient's address
recipient type - to recipient/cc recipient/bcc recipient/newsgroup
recipient -- the type of recipient
The 'address' data type referred to there is this one (again from Apple Mail
Suite):
Class address: An e-mail message address
Plural form:
addresses
Properties:
display name Unicode text -- the name used for display
address string -- the e-mail address
[It seems crazy that the 'address' data type also has an 'address' property
- the string email address, of course. Mail Suite's fault.]
So both 'recipient' and 'address' are records. You need to specify the
'recipient type' of each recipient if it's not 'to recipient'.
So this is how to do what you want:
tell application "Outlook Express"
make new outgoing message at folder "Outbox" with
properties {subject:the Subject, content:theContent,
recipient:{address:{address:emailAddress}, recipient type:bcc recipient},
attachment:attachmentList}
end tell
That's if your variable 'emailAddress' is of the format "email@hidden". If
it's actually "Joe Blow <email@hidden>", you'd need to separate the display
name from the address:
tell application "Outlook Express"
make new outgoing message at folder "Outbox" with
properties {subject: theSubject, content:theContent,
recipient:{address:{address:"email@hidden", display name:"Joe Blow"},
recipient type:bcc recipient}, attachment:attachmentList}
end tell
or by separate emailAddress and displayName variables. BTW, if you're
planning to distribute your script to other users, you should use
out box folder
rather than
folder "Outbox"
so that it will work on non-English versions as well.
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.