• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Accessing/creating mailboxes in Mail.app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Accessing/creating mailboxes in Mail.app


  • Subject: Accessing/creating mailboxes in Mail.app
  • From: LuKreme <email@hidden>
  • Date: Fri, 31 Dec 2010 13:51:41 -0700

I know I can say

repeat with eachAccount in imap accounts
  set myAccount to name of eachAccount
  set myMailbox to myAccount's mailbox "Test"
end repeat

But what if I want to access the mailbox "Foo" which is in the IMAP folder "Bar" which is under another folder named "2010"?

2010.Bar.Foo on the server side

First I tried (with Archives.2009):

set myMailbox to (myAccount's mailbox "2009" of (myAccount's mailbox "Archives"))

error "Can’t make \"Archives\" into type integer." number -1700 from "Archives" to integer

I tried to cheat by getting AppleScript to show me all the mailboxes:

tell application "Mail"
  repeat with eachAccount in imap accounts
    set myAccount to name of eachAccount
     set allMboxes to every mailbox in myAccount
     myAccount
     allMboxes
  end repeat
end tell

but that gives me:

error "Can’t get every mailbox of \"Work\"." number -1728 from every «class mbxp» of "Work"

Then, of course, I want to be able to create a mailbox if it doesn't already exist. I can't mess with that until I figure out how to get sub-folders though.

--
The real world was far too real to leave neat little hints. It was full
of too many things. It wasn't by eliminating the impossible that you got
at the truth, however improbable; it was by the much harder process of
eliminating the possibilities. --Feet of Clay

 _______________________________________________
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

  • Follow-Ups:
    • Re: Accessing/creating mailboxes in Mail.app
      • From: Axel Luttgens <email@hidden>
    • Re: Accessing/creating mailboxes in Mail.app
      • From: Luther Fuller <email@hidden>
  • Prev by Date: Re: convert PICT into PNG
  • Next by Date: Re: Accessing/creating mailboxes in Mail.app
  • Previous by thread: Re: convert PICT into PNG
  • Next by thread: Re: Accessing/creating mailboxes in Mail.app
  • Index(es):
    • Date
    • Thread