Re: Will Mail.app's message's every been scriptable?
Re: Will Mail.app's message's every been scriptable?
- Subject: Re: Will Mail.app's message's every been scriptable?
- From: Martin Crisp <email@hidden>
- Date: Wed, 21 Jul 2004 13:54:02 +1000
- Organization: Tesseract Computing
On Wed, 21 Jul 2004 12:11:01 +1000, Robert Nicholson wrote
(in message <
email@hidden>):
>
Does anybody know if Mail.app exposes the contents of mailboxes in the
>
Applescript object model?
>
>
If I'm not mistaken it's not possible currently to walk mailboxes and
>
their messages in Applescript in Mail.app like you can currently do in
>
Outlook and Entourage.
Wouldn't know about Outlook or Entourage (yes, I'm an anti-MS
bigot).
I didn't know whether Mail [1.3.8 (v618)] could or not (as I don't
use it).
But with a quick look at the app, and at its dictionary, it looked
possible...
This should display a dialog stating the subject of each unread
message in each inbox of each account...
tell application "Mail"
set myAccts to every account -- whose name is not "6x9"
repeat with anAcct in myAccts
set AccInBoxes to [NO BREAK]
(every mailbox of anAcct whose name is "INBOX")
repeat with aBox in AccInBoxes
if unread count of anInBox > 0 then
set unreadMessages to [NO BREAK]
(every message of anInBox whose read status is false)
repeat with anUnreadMessage in unreadMessages
display dialog (subject of anUnreadMessage as string)
end repeat
end if
end repeat
end repeat
end tell
the commented account is my only LDAP account, and it was taking
forever... [on dialup]
Perhaps others would be so kind as to point out some/any 'gotchas'
I'm unaware of...
Have Fun
Martin
_______________________________________________
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.