On
Apple's Scripting Mail page, Apple are trying to show off how scriptable Mail (the application) is under 10.1
However, I think they could have used better examples since Mail has some pretty arcane implementations in its dictionary.
For example:
<font face = "courier">
set this_message to make new compose message
at beginning of every compose message
</font>
What the hell does that mean to the uninitiated?
An, even worse, what does this line try to do?
<font face = "courier">
set the content
of this_message
to the content
of this_message</font>
Now, I'm a pretty savvy AppleScripter (even if I do say so myself), but I can't work out what possible purpose this line of AS is supposed to do (other than waste time).
This isn't the way to show people the power of AppleScript. In my opinion, THE code for ANY mail application to create and send a new message should be:
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
tell application <font color = red>"Mail"</font>
set the_Msg to new message
with properties (to address: <font color = red>"someone@somewhere.com"</font>, subject: <font color = red>"Test message"</font>, body: <font color = red>"Here's the body of the message"</font>)
send the_Msg
end tell
</font>[/code]
TWO lines of code is all it should take, and it should be written in such as way that any third grader could understand it. Can anyone tell me why it shouldn't be this easy? Can anyone who worked on Mail tell me why they didn't implement it this way?
Wouldn't the above code REALLY show the power of AppleScript? Anyone could look at that and think, "Wow, I could do that!" Not so with Apple's example.
The biggest problem with AppleScript is that the programmers don't put enough thought into the dictionary to make it usable by the average user. Unfortunately, as
this page shows, that goes for Apple programmers, too.
Come on, Sal. Don't you have any input in this?
Get with it, Apple.