Friday, November 22, 2024

applescript – Create a brand new mailbox for iCloud account through apple script

I discovered script components to create a mailbox in apple mail through apple script on a MacBook on Monterey:

inform software "Mail"
 activate
   make new mailbox with properties {title:"Father or mother Mailbox1/Youngster Mailbox1/"}
   make new mailbox with properties {title:"Father or mother Mailbox2/Youngster Mailbox2/"}
finish inform

Whereas execution I get a –> lacking worth output however the mailbox construction is created domestically:

Father or mother Mailbox1/Youngster Mailbox1

Father or mother Mailbox2/Youngster Mailbox2

If I now wish to do that with an iCloud account immediately:

inform software "Mail"
 activate
 inform account "iCloud"
   make new mailbox with properties {title:"Father or mother Mailbox1/Youngster Mailbox1/"}
   make new mailbox with properties {title:"Father or mother Mailbox2/Youngster Mailbox2/"}
 finish inform
finish inform

Apple Mail appears to be busy fairly a second by typical busy cursor indication, the worth lacking output is identical however no mailbox is created within the account. I even tried to enumerate the account id and used it as an alternative and tried on the finish of mailbox, however after the busy time round 6-8 seconds per mailbox, no mailbox is created.

I’ve no clue the place to search out some debuging data on why mails appears busy however doesn’t create the mailboxes. I considered extending it with a strive catch and error output, however possibly anyone already is aware of the explanation for apple mail behaviour on this space?

Variety regards

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles