• 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: applescripting sub mailboxes in Mail
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: applescripting sub mailboxes in Mail


  • Subject: Re: applescripting sub mailboxes in Mail
  • From: Christopher Stone <email@hidden>
  • Date: Thu, 19 Nov 2015 11:05:06 -0600

On Nov 18, 2015, at 05:21, Yvan KOENIG <email@hidden> wrote:
I added a slash at the end of the instruction :
make new mailbox with properties {name: "Year 2016/B/Tier03/Tier04/Tier05"}
so it became:
make new mailbox with properties {name: "Year 2016/B/Tier03/Tier04/Tier05/"}

This time, I got the box Tier06.
I added the instruction :
make new mailbox with properties {name: »Year 2016/B/Tier03/Tier04/Tier05/Tier06/Tier07/"} 
It failed so I edited the instruction creating the box Tier06 so that it end with a slash.
This code created the box Tier07.
My understanding is that if we want to be able to insert sub-boxes we must always put a slash at the end of instructions creating them.
Applying this « rule » the instruction :
make new mailbox with properties {name: »Year 2016/B/Tier03/Tier04/Tier05/Tier06/Tier07/Tier08/Tier09/Tier10/Tier11/"} 
created its entire hierarchy.
So, the engineers may continue to write that we don’t have to use the slash, I will ALWAYS insert an ending one.
______________________________________________________________________

Hey Yvan,

Interesting and relevant.

This sequence works fine:

tell application "Mail"
  make new mailbox with properties {name:"Year 2016/A/"} # WORKS
  make new mailbox with properties {name:"Year 2016/A/01/"} # WORKS
  make new mailbox with properties {name:"Year 2016/A/02/"} # WORKS
  make new mailbox with properties {name:"Year 2016/A/02/Tier04/"} # WORKS
  make new mailbox with properties {name:"Year 2016/B/Tier03/Tier04/Tier05/"} # WORKS
  make new mailbox with properties {name:"Year 2016/B/Tier03/Tier04/Tier05/Tier06/"} # WORKS
  make new mailbox with properties {name:"Year 2016/A/03/"} # WORKS
end tell

If I just change the 'Tier05' mailbox to exclude the ending '/' that line still works.

make new mailbox with properties {name:"Year 2016/B/Tier03/Tier04/Tier05"} # WORKS
make new mailbox with properties {name:"Year 2016/B/Tier03/Tier04/Tier05/Tier06/"} # FAILS

But the following 'Tier06' line fails, even though it has a trailing '/'. 

make new mailbox with properties {name:"Year 2016/B/Tier03/Tier04/Tier05/"} # WORKS
make new mailbox with properties {name:"Year 2016/B/Tier03/Tier04/Tier05/Tier06/"} # WORKS

Add back in the trailing '/' in the 'Tier05' line and the 'Tier06' line works again.

As you say the only certain way to create all mailboxes is to use the trailing slash.

AND

If you did NOT use a trailing slash when creating the mailbox it MAY NOT allow sub-mailboxes to be created in it.

--
Take Care,
Chris

 _______________________________________________
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: applescripting sub mailboxes in Mail
      • From: Yvan KOENIG <email@hidden>
References: 
 >Re: applescripting sub mailboxes in Mail (From: John Mitchell <email@hidden>)
 >Re: applescripting sub mailboxes in Mail (From: Brian Christmas <email@hidden>)
 >Re: applescripting sub mailboxes in Mail (From: Christopher Stone <email@hidden>)
 >Re: applescripting sub mailboxes in Mail (From: Yvan KOENIG <email@hidden>)

  • Prev by Date: Re: Email to Script Debugger or Script Editor
  • Next by Date: Re: applescripting sub mailboxes in Mail
  • Previous by thread: Re: applescripting sub mailboxes in Mail
  • Next by thread: Re: applescripting sub mailboxes in Mail
  • Index(es):
    • Date
    • Thread