Re: Send outgoing message error from Mail.app
Re: Send outgoing message error from Mail.app
- Subject: Re: Send outgoing message error from Mail.app
- From: Brian Christmas <email@hidden>
- Date: Wed, 27 Jan 2010 15:35:37 +1100
On 27/01/2010, at 3:27 PM, Alan Kimelman wrote: Brian,
I tried your script. The response I get is that outbox exists; but that every message of outbox is listed as {}, that is to say that Mail.app finds no message in its outbox. I have listed the following response found in the Events and Replies pane in the AppleScript Editor that appears after running your script.
tell application "Mail" activate exists outbox --> true get every message of outbox --> {} (*0*) Result: error "Can’t get item 1 of {}." number -1728 from item 1 of {}
For some reason, outbox lists no messages if the outgoing message. Did you experience a different response or event?
Alan
On Jan 26, 2010, at 7:47 PM, Brian Christmas wrote:
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
G'day Alan
I tried with a single stored message in the outbox, in an 'unsent' and not 'sending' condition. My code retrieved the id correctly. In fact, the following also 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) set temp1 to properties of msg set temp2 to all headers of msg --> 69642 set temp3 to paragraph 2 of temp2 end if end tell
Regards
Santa
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden