• 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: Mailbox creation problem in Sierra
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mailbox creation problem in Sierra


  • Subject: Re: Mailbox creation problem in Sierra
  • From: Brian Christmas <email@hidden>
  • Date: Mon, 12 Sep 2016 11:34:22 +1000



I’ve found the problem. It’s one that Apple fixed, and has now re-introduced with an added error bonus.

In El Capitan, a couple of the versions required a trailing slash to be added to each created mailbox name, but Apple fixed it in later versions after I lodged a bug report.

Now, you need the trailing slash again, but there’s a twist, you can no longer test for the existence of a mailbox, if it’s nested. Even when adding a slash to the testing name, no go!

I’ve lodged a new bug report, and if anyone wants to add another, feel free. The more complaining, the sooner Apple might fix it again.

Run the new attached script several time, to see what I’ve found out.

Regards

Santa


set tempYearString to "2017"
property theMonth : "09"
property dailyName : "02"
tell application "Mail"
activate
######################################################
# Make Yearly mailbox
######################################################

# This works

if not (exists mailbox tempYearString) then
make new mailbox with properties {name:tempYearString & "/"}
repeat until exists mailbox tempYearString
do shell script ("sleep 0.1")
end repeat
end if
######################################################
# Make Monthly mailbox
######################################################
set loopCounter to 0
if not (exists mailbox (my theMonth) of mailbox tempYearString) then
try
make new mailbox with properties {name:(tempYearString & "/" & (my theMonth) & "/")}
on error errmsg
tell application "System Events" to display dialog "1 " & errmsg
end try
end if
set loopCounter to loopCounter + 1
do shell script ("sleep 0.1")
######################################################
# Make Daily mailbox
######################################################
if not (exists mailbox (my dailyName) of mailbox (my theMonth) of mailbox tempYearString) then
try
make new mailbox with properties {name:(tempYearString & "/" & my theMonth & "/" & my dailyName)}
on error errmsg
tell application "System Events" to display dialog "2 " & errmsg
end try
end if
end tell
say "Now running without added slashes"
set tempYearString to "2018"
tell application "Mail"
activate
######################################################
# Make Yearly mailbox
######################################################

# This works

if not (exists mailbox tempYearString) then
make new mailbox with properties {name:tempYearString}
repeat until exists mailbox tempYearString
do shell script ("sleep 0.1")
end repeat
end if
######################################################
# Make Monthly mailbox
######################################################
set loopCounter to 0
if not (exists mailbox (my theMonth) of mailbox tempYearString) then
try
make new mailbox with properties {name:(tempYearString & "/" & (my theMonth))}
on error errmsg
tell application "System Events" to display dialog "3 " & errmsg
end try
end if
set loopCounter to loopCounter + 1
do shell script ("sleep 0.1")
######################################################
# Make Daily mailbox
######################################################
if not (exists mailbox (my dailyName) of mailbox (my theMonth) of mailbox tempYearString) then
# activate
try
make new mailbox with properties {name:(tempYearString & "/" & my theMonth & "/" & my dailyName)}
on error errmsg
tell application "System Events" to display dialog "4 " & errmsg
end try
end if
end tell


And what, you ask, was the beginning of it all?
And it is this......
Existence that multiplied itself
For sheer delight of being
And plunged with numberless trillions of forms
So that it might
find
itself
innumerably

Sri Aurobindo



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Mailbox creation problem in Sierra (From: Brian Christmas <email@hidden>)

  • Prev by Date: Mailbox creation problem in Sierra
  • Next by Date: Ongoing problem with Bill Cheesemans Accessibilty code snippet.
  • Previous by thread: Mailbox creation problem in Sierra
  • Next by thread: Ongoing problem with Bill Cheesemans Accessibilty code snippet.
  • Index(es):
    • Date
    • Thread