On Jan 02, 2011, at 04:51, Axel Luttgens wrote: I just see a slight potential problem: Mail's frontmost window isn't necessarily a message viewer so that, strictly speaking, one has to take the index value into account. ______________________________________________________________________
Hey Axel,
Nice.
I hadn't intended that routine to work if the front window wasn't a message viewer, but I hadn't considered getting just the indices of the message viewer windows. So your script gives me a thing or two to think about. Thanks.
Now. Do you have a slick way of determining if the front message is an outgoing message and getting a reference to it?
In Eudora you could easily discover what kind of window was frontmost, and you could refer to the front message as 'message 0', and you could tell if it was outgoing. It was pretty convenient.
Here's my kludgy work-around for Mail:
tell application "Mail" set frontWindowName to item 1 of (get name of windows whose name is not "") set foundMessages to messages of drafts mailbox whose subject is frontWindowName # If more than one this should be the most recent: set frontOutgoingMessage to item 1 of foundMessages
properties of frontOutgoingMessage end tell
** Note: this fails if you do not save the front outgoing message before running the script (or do not wait many seconds for Mail to register the fact that it has a new outgoing message).
|