Re: Scripting OS X Mail app
Re: Scripting OS X Mail app
- Subject: Re: Scripting OS X Mail app
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 31 Jan 2002 13:02:56 -0800
On 1/31/02 3:56 AM, "Steven Angier" <email@hidden> wrote:
>
OE/Entourage can be a bit difficult. Firstly, you can't send a message without
>
having set
>
up a POP account (perhaps this is an anti-spam measure?) so you have to create
>
a POP
>
account based on each sender's information. You also have to watch out that
>
you don't try
>
to exceed the limit of 127 POP accounts -- so your code has to manage and
>
destroy the POP
>
accounts when you are finished with them -- so you need to check that the
>
messages using
>
the account have been sent before you destroy the POP account -- etc.
Hmmm. The need not to exceed 128 POP accounts (I wasn't aware of this
limitation but I'm happy to take your word for it) is not one that will
usually be faced by "beginning scripters", your concern here. Why would you
need so many from one from copy of OE? Are you an administrator of a large
organization with multiple users on machines accessible to all users, or
something like that? This really is not the typical setup for "beginning
scripters".
>
>
Then you have to build a list of recipients in a fairly unintuitive way IMHO.
>
>
Many email clients allow you specify separate lists of TO, CC, and BCC
>
recipients; if the
>
CC list is empty, fine; if you supply a list of TO addresses, thats fine too.
>
>
OE/Entourage requires that you build a record of type recipient for each
>
recipient:
>
{address: "actual email address", recipient type: to/cc/bcc recipient} and
>
throw them all
>
into the one list.
Actually, that's not quite true. OE/Entourage was being a good "Apple
citizen" when it adopted this crazy syntax (the worst part is 'address of
the address') of Apple's Mail Suite. It's the Mai Suite that insists on it,
and OE/Entourage is just following protocols, although nobody else does
except Emailer. little did anyone know that Apple itself would throw away
this syntax in its own Mail.app. However, there are undocumented shortcuts
you can use; if you are sending only to To recipients, you can do this
recipient:{"Joe Blow <email@hidden>", "John Smith
<email@hidden>"}
without any reference to recipient type, address, display name or anything.
That will usually do OK for "beginning scripters". But to include recipient
type, you do have to use the syntax of the Apple Mail Suite. However,
beginning scripters are often quite happy to make draft windows on the
screen, rather than outgoing messages in the out box. Draft windows take the
syntax you like:
to recipients:"Joe Blow <email@hidden>, John Smith
<email@hidden>" , cc recipients:"email@hidden,
email@hidden"
That will work just fine.
>
Furthermore, you have to create an "outgoing" message (as
>
if you would
>
want to create an "incoming" message!), and assign the recipient list when you
>
create the
>
message (i.e. make new outgoing message with properties {blah}) because it
>
will error if
>
you try to set the recipients property after you create the message.
But not draft windows. You can open up a saved message, then change the "to
recipients" or "cc recipients" of window 1. (The window will have the same
name as the message subject, as a check.) It is a limitation that you can't
change recipients of messages. I don't see what's wrong with 'outgoing
message': it's in the Dictionary as a class. There are properties which an
incoming message has which an outgoing message doesn't, and vice versa
('deliver status', for example). [And there are certain circumstances where
you might indeed want to make a new incoming messages: edit the source of a
received message, make a new incoming, and reply to it: that's a way to do
edited HTML, otherwise not possible.]
>
>
The combination of these factors make it a frustrating experience to new
>
scripters. Being
>
able to send attachments was the only reason we left Mail OSAX from Vampire
>
Software.
I sure wish that the Mail Suite's recipient class were less cumbersome
myself.
--
Paul Berkowitz