[OSX] How to make a MailBox in Mail.app
[OSX] How to make a MailBox in Mail.app
- Subject: [OSX] How to make a MailBox in Mail.app
- From: email@hidden
- Date: Tue, 19 Jun 2001 19:56:02 +1000
Hi Scripters,
Does anybody know the correct syntax for creating a mailbox in Mail.app?
My script was this one
--
tell application "Mail"
set theAccountList to every account
repeat with anAccount in theAccountList
if account name of anAccount is "Personal Mailboxes" then set
PersonalMail to anAccount
end repeat
make new mailbox at PersonalMail with properties {mailbox
name:"Testing"}
end tell
--
As you can see, I test to find out where my target is going to be made,
in this case "Personal Mailboxes". The script fails with "Mail got an
error: The "at" argument to the create command must be a
NSPositionalSpecifier. Instead it was a LocalAccount."
But mailboxes are elements of accounts... "NSPositionalSpecifier" is
obviously a Cocoa class, what's it's equivalent AppleScript class in
Mail.app? Just to confuse the issue "local account" is another class, as
distinct from "account", which also has mailboxes as elements...
The idea of all this is to create mailboxes named after the senders of
email. 90%+ of my email comes from a certain set of individuals,
characterised by a common part in their email address, so i want to be
able to test for the existence of a mailbox for that sender and if it
doesn't exist, create it. Once I have verified that it exists, move the
message to that mailbox.
Peter