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

Mailbox creation problem in Sierra


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

G’day once again scriptures

Sorry about the amount of traffic I’m generating, but Sierra has some real issues.

I’ve once again struck problems with the Mail.app. Apple seems to have once again stuffed things up.

It refuses to create nested folders, and I’ve tried lots of methods, including ending the creation string with  “/“. No success.

I can’t find anything Googling, it’s simply too new.

Any thoughts, anyone?

Regards

Santa

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


# This works


if not (exists mailbox tempYearString) then
say "year"
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
#Fails
try
make new mailbox with properties {name:(tempYearString & "/" & (my theMonth))}
on error errmsg
tell application "System Events" to display dialog "1 " & errmsg
end try
# Fails
try
make new mailbox at mailbox tempYearString with properties {name:(tempYearString & "/" & (my theMonth) )}
on error errmsg
tell application "System Events" to display dialog "2 " & errmsg
end try
try
make new mailbox at mailbox tempYearString with properties {name:(my theMonth)}
on error errmsg
tell application "System Events" to display dialog "3 " & errmsg
end try
set x to 0
end if
set loopCounter to loopCounter + 1
do shell script ("sleep 0.1")
try
if not (exists mailbox (my theMonth) of mailbox tempYearString) then
activate
set selected mailboxes of message viewer 1 to mailbox tempYearString
tell application "System Events" to tell process "Mail"
click menu button 2 of splitter group 1 of window 1
click menu item "Erase Deleted Items…" of menu 1 of menu button 2 of splitter group 1 of window 1
set x to 0
repeat until exists sheet 1 of window 1
do shell script ("sleep 0.1")
set x to x + 1
if x ≥ 30 then exit repeat
end repeat
keystroke return
end tell
end if
end try
try
tell application "Mail"
if exists mailbox (my theMonth as rich text) of mailbox (tempYearString as rich text) then exit repeat
end tell
on error errmsg number errnum
if errnum ≠ -2763 then if my runForOz then tell application "System Events" to display dialog "MainProcessingLoops's transferMessageMailboxCreator exit loop " & errmsg & " number is " & errnum & return & my theMonth & return & tempYearString as text giving up after 40
exit repeat
end try
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

  • Follow-Ups:
    • Re: Mailbox creation problem in Sierra
      • From: Brian Christmas <email@hidden>
  • Prev by Date: Re: Why is it so?
  • Next by Date: Re: Mailbox creation problem in Sierra
  • Previous by thread: Re: Why is it so?
  • Next by thread: Re: Mailbox creation problem in Sierra
  • Index(es):
    • Date
    • Thread