However, even with the correct coding, the upper level mailbox is created correctly, but nested mailboxes fail, even trying multiple formats.
tell application "Mail"
activate
try
make new mailbox with properties {name:"Year 2016"}
say "Mail box Year 2016 created."
on error errmsg
say "Mail box 2016 try one failed to be created"
end try
try
make new mailbox at beginning of mailboxes of mailbox "On My Mac/Year 2016" with properties {name:"Year 2016/11"}
say "Mail box Year 2016 created, sub mailbox 11 created"
on error errmsg
say "Mail box 2016 11 try 2 failed to be created"
end try
try
make new mailbox at beginning of mailboxes of mailbox "Year 2016" with properties {name:"Year 2016/11"}
say "Mail box Year 2016 created, sub mailbox 11 created"
on error errmsg
say "Mail box 2016 11 try 3 failed to be created"
end try
try
make new mailbox at mailbox "Year 2016" with properties {name:"Year 2016/11"}
say "Mail box Year 2016 created, sub mailbox 11 created"
on error errmsg
say "Mail box 2016 11 try 4 failed to be created"
end try
try
make new mailbox with properties {name:"Year 2016/11"}
say "Mail box Year 2016 created, sub mailbox 11 created"
on error errmsg
say "Mail box 2016 11 try 5 failed to be created"
end try
try
make new mailbox at beginning of mailboxes of mailbox "Year 2016/11" with properties {"2016 11 17"}
on error errmsg
say "Mail box 2016 11 17 try 6 failed to be created"
end try
end tell
On 17 Nov 2015, at 11:46 AM, Stockly, Ed <
email@hidden> wrote:
In a quick glance it looks like you’ve got the property spec wrong.
I didn’t fix and test the other versions, but it looks the same in them.
Or, am I missing something? (Haven’t been following the thread, that closely, but I’m going to be scripting Mail this week…)
tell
application "Mail"
activate
try
--make new mailbox with properties "Year 2016” — doesn’t work
make
new
mailbox
with properties {name:"Year
2016”}— works
say "Mail box Year 2016 created."
on
error errmsg
say "Mail box 2016 try one failed to be created"
end
try
end
tell
On Nov 16, 2015, at 3:59pm, Brian Christmas <
email@hidden> wrote:
tell application "Mail"
activate
try
make new mailbox with properties "Year
2016"
say "Mail box Year 2016 created."
on error errmsg
say "Mail box 2016 try one failed to be created"
end try
try
make new mailbox at beginning with
properties "Year 2016"
say "Mail box Year 2016 created."
on error errmsg
say "Mail box 2016 try two failed to be created"
end try
try
make new mailbox at beginning of mailboxes of mailbox "On
My Mac" with properties "Year 2016"
say "Mail box Year 2016 created."
on error errmsg
say "Mail box 2016 try three failed to be created"
end try
try
make new mailbox at beginning of mailboxes of mailbox "On
My Mac" with properties "Year 2016/11"
say "Mail box Year 2016 created, sub mailbox 11 created"
on error errmsg
say "Mail box 2016 11 failed to be created"
end try
try
make new mailbox at beginning of mailboxes of mailbox "Year
2016/11" with properties {"2016 11 17"}
on error errmsg
say "Mail box 2016 11 17 failed to be created"
end try
end tell