Jump to content

Getting list of email mailboxes?


Recommended Posts

I've seen several workflows that do things like autocomplete tags, or folders, or something else. I'm wondering if there is a way to autocomplete mailboxes in mail.app? My use case would be a keyword to move a mail message, allowing the user to start typing the desired mailbox with the workflow providing matches.

 

Any ideas?

Link to comment

You could certainly use Alfred to display a list of mailboxes (that match your query). But first of all, you'll need a script that fetches a list of all your mailboxes from Mail.app including the mailbox ID you'll need to get a reference to the mailbox in your downstream script.


After that, it's mostly a case of wrapping that list up in Alfred's Script Filter JSON. AppleScript truly sucks for JSON, so it'd be a smarter approach to use JXA (JavaScript for Automation), which supports JSON natively, or combine AppleScript with some other language with decent JSON support.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...