Re: [mac os x] count of messages from mail
Re: [mac os x] count of messages from mail
- Subject: Re: [mac os x] count of messages from mail
- From: Paul Berkowitz <email@hidden>
- Date: Sat, 09 Jun 2001 08:32:07 -0700
On 6/9/01 1:43 AM, "Jacco Rens" <email@hidden> wrote:
>
hi all,
>
>
tell application "Mail"
>
set x to the count of the messages of mailbox "AppleScript Users"
>
end tell
>
display dialog x
>
>
gives me;
>
Mail got an error:
>
NSReceiverEvaluationScriptError: 3
>
>
does this mean that Mail's scripting is still in beta form, or did i do
>
something wrong?
>
Both, It seems.
If you look at the 'application' entry for Mail, you'll see that there is no
element 'mailbox' listed there. But if you look under 'account', or any of
the various individual account types such as 'local account', you'll find
'mailbox' there. Playing around with 'account name of account 1', etc., it
turns out that your main 'Personal Mailboxes', including your main INBOX
actually belong to your local account "Personal Mailboxes". (Although the
'mailbox name of mailbox 1 of account 1' is recorded as "INBOX.mbox", and
'name of mailbox 1 of account 1' errors and 'mailbox "INBOX.mbox" of
account 1' errors,
mailbox "INBOX" of account "Personal Mailboxes"
or
mailbox "Inbox" of account 1
are both fine, and same for other mailboxes. So, depending on your setup
set x to the count of the messages of mailbox "AppleScript Users" of
account "Personal Mailboxes"
or of the actual POP or IMAP account you're using, such as
set x to the count of the messages of mailbox "AppleScript Users" of
account "mac.com"
will both run fine , without error. Unfortuinately, the result they give,
for every mailbox I have, is
--> 0
That's it: 0. I think that one counts as a "still in beta form", otherwise
known as "bug".
--
Paul Berkowitz