How to display Mail's 'parent' INBOX folder


New to this forum so forgive any newbie mistakes.

I am trying to write an Applescript for Mac Mail - just a simple one to move junk/spam for all three accounts I have into Deleted Messages and then erase them. It works fine, but what I’d like it to happen is that after it has completed the erase messages action it then displays the Inbox folder.

I can get it to display the iCloud account inbox with this:

tell application "Mail"
	set the selected mailboxes of the front message viewer to {mailbox "INBOX" of account "iCloud"}
end tell

but can’t figure out how to display the ‘parent’ folder so I can see all account’s inboxes.

Any thoughts?

All the best from London!!

Cheers, Brett

Model: MacBook Pro (Retina, 15-inch, Mid 2015)
AppleScript: 2.7
Browser: Safari 605.1.15
Operating System: macOS 10.14

Hi. If an inbox is in quotes, then it’s a subordinate mailbox. The top level isn’t quoted.

tell application "Mail" to set front message viewer's selected mailboxes to inbox

Wow! Fast…! and a great solution, thank yo so much.

Chees, Brett