On 27/01/2010, at 12:38 PM, Alan Kimelman wrote: If this is a bug, what would be the next step? On Jan 26, 2010, at 3:30 PM, Luther Fuller wrote: I was thinking you were perhaps using the wrong mailbox. So I experimented. First, an outgoing message seems to be any message in the Drafts mailbox or the Outbox mailbox that is open in Mail. So, I opened two messages in my Drafts mailbox and ran variations of this script ...
tell application "Mail" activate set outList to outgoing messages log (count items of outList) --> 2 set msg to (item 1 of outList) id of msg -- Mail got an error: Can't get id of outgoing message id 7. end tell
I have used 'id of msg' before and it works. But, I've never used it with 'outgoing message'.
In the special case of 'outgoing messages' there seems to be a problem. ALL of the properties of 'outgoing message' seem to be broken. This is particularly ironic for 'id' ... if Mail can get the id to put into an error message, then there is no error and the error message "Mail got an error: Can't get id of outgoing message id 7." does not exist. Perhaps it's a mirage.
I smell a bug, here
G'day
I don't think there is a bug, other than there's no such thing as 'outgoing messages'.
The first thing that makes me think your code is in error is that there's no such thing as a message with a single digit id, they're all 5 digits.
The second thing is you need to address the outbox, not messages in the Drafts.
The following code works...
tell application "Mail" activate if exists outbox then set outList to messages of outbox log (count items of outList) --> 1 set msg to (item 1 of outList) get id of msg --> 69642 end if end tell
To get an outbox with messages, click the cross to the right of any outgoing message, and it should create an outbox with the unsent message in it.
Regards
Santa |