• 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
Re: Scripting mail create a mailbox in a mailbox (folder)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting mail create a mailbox in a mailbox (folder)


  • Subject: Re: Scripting mail create a mailbox in a mailbox (folder)
  • From: John Mitchell <email@hidden>
  • Date: Sun, 9 Jan 2005 04:14:46 +1100

Title: Re: Scripting mail create a mailbox in a mailbox (folder)

In Mail I use this routine to create a Mailbox (actually, functionally  a mail folder)

                tell application "Mail"
               
try
                            
make new mailbox at beginning with properties {name:newMailFolder}
                     
on error errMsg number errNum
                          
display dialog "Could not create new category folder <" & newMailFolder & "> (Mail)" & return ¬
                                &
errMsg buttons {"Quit"} default button 1
                             
return {false}
                 
end try
       
end tell

eg
set {flag} to createMailFolder("Mail", "", "Babble") of me

 this works; however when I try to make a mailbox in it, using this routine:

                tell application "Mail"
                        if not (exists mailbox mailBoxName of mailbox thismailFolder) then
                                try
                                        set folderRef to (make new mailbox at beginning of mailbox thismailFolder ¬
                                                with properties {name:mailBoxName})
                                on error
                                        display dialog "Cannot make new mailbox " & mailBoxName & "(Mail)"
                                        return {false, boxExists}
                                end try
                        else
                                display dialog "Mailbox <" & mailBoxName & "> already exists" & return ¬
                                        & "in mail folder " & thismailFolder buttons {"Continue"} default button "Continue"
                                set boxExists to true
                        end if
                end tell

eg set {flag, folderRef} to createMailBox("Mail", "", "Projects", "Headquarters") of me

there is no error message but nothing is created. This same result happens if I modify the createMailFolder routine to create a mailbox inside a Mailbox.

 If the mailbox exists it behaves correctly, ie it finds the mailbox in the mailbox

any clues?

--
regards


John
--------------------------------------------------------------------------------------------------------------------------------------------
John Mitchell, Director, IFC Interoperability, Graphisoft R&D Rt
11 Terrell Avenue, Wahroonga, NSW 2076 Australia
Email:  email@hidden      
Tel: +61 (2) 9489 3785 € Fax: +61 (2) 9489 4035 € Mob:+61 410 318 131
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: [QuarkXPress 5] how to get "on styles" ? (Fixed, kind of...)
  • Next by Date: Converting Hex to binary
  • Previous by thread: Re: [QuarkXPress 5] how to get "on styles" ? (Fixed, kind of...)
  • Next by thread: Converting Hex to binary
  • Index(es):
    • Date
    • Thread