• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Is Mail scriptable ??
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is Mail scriptable ??


  • Subject: Re: Is Mail scriptable ??
  • From: cricket <email@hidden>
  • Date: Sat, 16 Nov 2002 23:00:18 -0800

On Saturday, November 16, 2002, at 03:03 PM, John Delacour wrote:

Why can't you just keep things simple like any other mailer. What you seem to be proposing is that in a future version we write:

tell app "Mail" to get content of document in window 1

Not only is this totally unintuitive and verbose but it further complicates an aete that is already completely chaotic.

Wiring up a document to a window in our object model doesn't mean you'll have to specify the whole containment hierarchy in a script command. There are provisions in Cocoa scripting for abstracting away the object model to create something that is more natural for scripters.

Since things are so bad, why don't you just scrap the whole thing, have a look at how other people do things and try to write an aete that is at least just as good or preferably better? Even TextEdit is marginally more rational but still completely out on a limb, but its syntax is completely different from Mail's. At least one might expect Apple to balls up both programs equally badly with the same lousy syntax.

Sorry to disappoint you, but we're not scrapping the whole thing. :) In Mail's second major release (essentially 2.0), we have a good solid foundation, some bugs, and a few holes remaining. If you compare our dictionary to any email client, they all have quirks and holes. Entourage can't move IMAP messages via script (at least the last time I tried it). I think _that's_ lame. You think that not getting the contents of a received message is lame. Just depends on how the priorities are set by our respective teams. We plan to have the best scriptable Mail client out there. Everyone else had a 5 year head start. :)

If I write this:

tell application "Mail"
set m to make outgoing message at end of outgoing messages
tell m
open
set its content to "hello"
end tell
end tell

I get an error:

tell application "Mail"
make at end of every outgoing message new outgoing message !!!!!
--> outgoing message id 28009056
open outgoing message id 28009056
<<event ascrgdut>>
--> {}
open outgoing message id 28009056
--> Mail got an error: outgoing message id 28009056 doesn't understand the open message.

If I omit the open command, the script runs, but I can see no evidence that any message has been created at all!

Instead, the only Mail script provided by Apple, the aptly-named "Crazy Message Text.scpt" suggests that this is minimum required to perform the most basic operation:


set this_message to make new outgoing message at end of outgoing messages with properties {visible:true}


Mein Gott!!

The default for sending is visibility set to false, which is demonstrated in the example scripts on the Jaguar CD and in the Mail scripting dictionary. All you need is this:

make new outgoing message with properties {visible: true}

This makes a lot of sense to work this way. If you want to do silent sends, what you'd end up with is a window flashing up on the screen, then you tell it to go away by setting visibility to false. We tried it the other way and it was less than desirable.

Just take a breath and give us some time -- you'll see we've got an excellent dictionary and we're clearly committed to making it better (e.g. the tripling of the content of the dictionary between 10.1 and 10.2 -- rules, signatures, accounts, and all of preferences is now fully scriptable). Cocoa and Applescript are newly acquainted friends that need just a little bit more time. In the meantime, as you've mentioned, there are other clients out there that may meet your exact need at this time. Go use them and come back to Mail if and when it meets your needs. To tell you the truth, I don't understand why you are so worked up about it. It's a free email client in a sea of other capable email clients. Pick the one you are happiest with and go with it. You'll feel better!

Do you think I'm replying to this at 11pm on a Saturday night because I don't care about Mail and Applescript? :)

- cricket

----->
Software Entomologist  Mail for Mac OS X
http://www.apple.com/macosx/jaguar/mail.html
---------->
The fridge is the last place that food would hide
_______________________________________________
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.

  • Follow-Ups:
    • Re: Is Mail scriptable ??
      • From: "John C. Welch" <email@hidden>
References: 
 >Re: Is Mail scriptable ?? (From: John Delacour <email@hidden>)

  • Prev by Date: Re: Scripting "Startup Disk" revisited
  • Next by Date: Re: Identifying BBEdit version + testing for presence of OSAXen
  • Previous by thread: Re: Is Mail scriptable ??
  • Next by thread: Re: Is Mail scriptable ??
  • Index(es):
    • Date
    • Thread