applescripting sub mailboxes in Mail
applescripting sub mailboxes in Mail
- Subject: applescripting sub mailboxes in Mail
- From: John Mitchell <email@hidden>
- Date: Tue, 10 Nov 2015 09:34:40 +1100
Scripters
tks for confirmation…what response might happen when...
> G’day John
>
> It looks as though you’ve found a serious bug in El Capitans Mail.app
>
> I thought at first your problem might have been your use of smart quotes, and lack of the ‘as rich text’ command, but replacing them made no difference.
>
> The was a problem in Yosite in that if you created a subsidiary mailbox, then deleted it, then tried to re-create the subsidy mailbox, Mail.app refused until the top level mailbox was re-built.
>
> I modified your code, but it still doesn’t work.
>
> Anyone know an answer before I lodge a bug report. I also REALLY need this to work in El Capitan.
>
> Regards
>
> Santa
>
> tell application "Mail"
> activate
> if not (exists mailbox "Bar") then make new mailbox with properties {name:"Bar"}
> do shell script ("sleep 0.1")
> set selected mailboxes of message viewer 1 to mailbox "Bar"
> tell application "System Events" to tell process "Mail"
> click menu bar item "Mailbox" of menu bar 1
> do shell script ("sleep 0.1")
> click menu item "Rebuild" of menu 1 of menu bar item "Mailbox" of menu bar 1
> end tell
> do shell script ("sleep 0.1")
> if not (exists mailbox "Dandy" of mailbox "Bar") then
> beep
> repeat until exists mailbox "Dandy" of mailbox "Bar"
> try
> make new mailbox with properties {name:("Bar/Dandy" as rich text)}
> end try
> do shell script ("sleep 0.1")
> end repeat # Loops indefinitely
> end if
> do shell script ("sleep 0.2")
> if not (exists mailbox "Jim" of mailbox "Dandy" of mailbox "Bar") then
> beep
> try
> make new mailbox with properties {name:"Bar/Dandy/Jim"}
> on error errmsg
> display dialog errmsg
> end try
> end if
> end tell
> On 8 Nov 2015, at 7:04 AM, John Mitchell <email@hidden <mailto:email@hidden>> wrote:
>
> Scripters
>
> I am trying to create a 3 hierarchy mail box
>
> ie Bar>Dandy>Jim
>
> tell application "Mail"
> --tell account "On My Mac"
> set mbox to make new mailbox with properties {name:"Bar"}
> make new mailbox with properties {name:"Bar/Dandy"}
> set selected mailboxes of message viewer 1 to {mailbox "Dandy" of mailbox "Bar"}
> make new mailbox with properties {name:”Dandy/Jim”} - fails
> make new mailbox at end of mailbox "Dandy" with properties {name:”Dandy/Jim”} - fails
> make new mailbox with properties {name:”Bar/Dandy/Jim”} - fails
>
> --end tell
> end tell
>
> Dany is correctly created, but Jim is not, for the above options
>
> any advice?
>
> regards
>
>
> John
>
> Email: email@hidden <mailto:email@hidden> • Mob: +61 410 318 131
regards
John
CQR Pty Ltd
1005/2 Dind Street, Milsons Point, NSW 2061 Australia
ABN: 45 001 785 191 • NSW ARBN: 3605
Email: email@hidden • Mob: +61 410 318 131
Skype: jrmitchell
Tel: +61 (2) 9922 3785
_______________________________________________
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