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 post

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 post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...