• 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: Brian Christmas <email@hidden>
  • Date: Tue, 17 Nov 2015 12:40:02 +1100
  • X_v_e_cd: 748115768205bd3d12c9b8e97853dbe2
  • X_v_r_cd: 74465475b41934d1c518e2459d5c0e78

Thanks Ed, very, very remiss of me not to get to coding correct.

However, even with the correct coding, the upper level mailbox is created correctly, but nested mailboxes fail, even trying multiple formats.

Regards

Santa

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



 _______________________________________________
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

References: 
 >Re: applescripting sub mailboxes in Mail (From: Brian Christmas <email@hidden>)
 >Fwd: applescripting sub mailboxes in Mail (From: Brian Christmas <email@hidden>)
 >Re: applescripting sub mailboxes in Mail (From: "Stockly, Ed" <email@hidden>)

  • Prev by Date: Re: applescripting sub mailboxes in Mail
  • 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