# Using keybindings in MailMate

I made a few changes to how I used MailMate to make it easier and quicker to use.

# Background

I’ve been using MailMate for a year or two - but only in very basic way, no customization at all. With the arrival of El Capitan I switched back to the standard Mail application to see if it had improved and it had. However, I don’t really like Mail. So despite that Mail is tightly integrated with OS X, decided to use MailMate instead.

Anyway, I noticed that I had started to use colored flags for quickly working through my incoming emails (I do like an empty inbox). By quickly scanning the emails and assigning different flags I was able to categorize the messages and then file them away.

I used three different colors to mark messages that I didn’t handle immediately, the flags were

Fix
Something I need to do something about later.
Waiting
Reference
A message with info that I knew that I would need in the near future.

After flagging the messages I would archive them and then use the flag “mailboxes” in the sidebar to find the messages later. I really liked working this way so when I switched back to MailMate I wanted to keep this workflow.

# MailMate

MailMate doesn’t have colored flags so I needed to figure out some other way of working like this. I asked around a bit and decided to try to use tags instead and create some “smart mailboxes” that searched for those tags. Unfortunately, it’s a bit cumbersome to work with tags in MailMate so at first it didn’t work well. It took way too much time to go through the inbox and tag the messages.

After more manual reading and some question on the MailMate mailing list I realized that there was a way to do what I wanted and even make my workflow better: Key bindings.

## Key bindings

In OS X you can add shortcuts to a menu item in most apps using the “Keyboard->Shortcuts” preferences. But MailMate has another way of doing this that is a bit “geeky” but more powerful. By creating a text file in a certain format it’s possible to bind key strokes to different actions. For example to assign keywords to email messages!! And it’s even possible use a sequence of key strokes so I can for example use “ff” to flag a message with the “Fix” keyword.

## Deciding on how I wanted MailMate to work

With this information I quickly decided to set up a number of keybinding that would allow me to set/remove keywords with two key strokes and with the help of a few smart mailboxes I would get the result I wanted.

I also decided on adding a fourth tag “ReadLater” for messages that I didn’t need to take any action on but still wanted to read at a later date.

# The set up

Here are the steps for setting up MailMate.

## Setting up the tags

To get this to work the first step is to define the tags in MailMate. To do this: open preferences in MailMate and select the “Tag” icon. This is how my current setup looks like.

Use the “+” button to create new tags. Note that there are three things you need to define for each tag: Display name, IMAP Keyword and an icon that represents the tag.

The icons are emoji symbols and one way of entering them is to open the keyboard preferences.

Then check the “Show Keyboard, Emoji & Symbol Viewers in menu bar”

Click on that and then on “Show Emoji & Symbols” to show the actual window.

Now you can double-click the symbol you want to insert it as the symbol for a tag.

## Setting up the mailboxes

To easily find the tagged messages you need to set up a number of smart mailboxes. To do this, select “Mail->New Smart Mailbox” in MailMate and then set it up like this:

The actual conditions of course depends on your specific needs. My finished setup looks like this (I have an extra mailbox “Flagged” for emails that I’ve flagged in other email applications).

## Defining the key bindings

There is a description of how the key bindings work in the MailMate manual so I will not repeat it here. I wanted to have the following key bindings

Keystrokes Action
ff Flag message with “Fix”
fw Flag message with “Waiting”
fr Flag message with “Reference”
rf Remove flag “Fix” from message
rw Remove flag “Waiting” from message
rr Remove flag “Reference” from message
rl Remove flag “ReadLater” from message

This translates to the following settings file:

{
"f" =  {
"f" = ( "setTag:", "Fix" );
"w" = ( "setTag:", "Waiting" );
"r" = ( "setTag:", "Reference" );
"l" = ( "setTag:", "ReadLater" );
};
"r" =  {
"f" = ( "removeTag:", "Fix" );
"w" = ( "removeTag:", "Waiting" );
"r" = ( "removeTag:", "Reference" );
"l" = ( "removeTag:", "ReadLater" );
};
}


I have this saved in a file called “jem.plist”. This file is saved in the folder ~/Library/Application Support/MailMate/Resources/KeyBindings where ~ represents my home folder, shown as an image below.

Make sure you relaunch MailMate after doing this.

## Final step

There is one more thing you need to do, tell MailMate to use the keybindings defined above. To do this open MailMate preferences and on the Generals tab, check the “Enable” checkbox and fill in the name of the bindings file (without the “.plist” part) in the text file.

You should now be able to use your new labels/shortcuts.

# How to use it

An example of how it works on my machine. First select a message

then press “fl” to flag it for later reading

then archive the message. Now the message is gone from the inbox but by selecting the “Read later” mailbox it’s displayed again.

You can make the whole experience even better by using two features of MailMate

## Counters

I really like the “counters” that MailMate can display in the menu bar. I use these to indicate how many unread messages there are in my inbox, total number of messages in inbox and how many messages that are tagged to be fixed.

So here I can see that I have 5 unread messages and a total of 7 messages in my inbox.

Here is how I set up one of the counters to show how many messages are tagged to be fixed.

## Message count display in mailbox list

Normally the mailbox list looks like this

There is no visible indication if there are any messages in the “Fixa” mailbox. But by control-clicking the mailbox I can tell MailMate to display the number of messages in the mailbox.

After this you can immediately see how many messages that needs your attention

# A comment from MailMate’s developer

Benny, the developer of MailMate writes:

Thanks for the thorough guide! Just a few remarks. 1. MailMate does have some support for colored flags (compatible with Apple Mail). It would work with key bindings, but I think the tags/emojis are better (actually you could use both). 2. You could use toggleTag: to just have one set of key bindings, but you might not prefer that. 3. You can use ⌃⌘+space to open the emoji panel in any text field on El Capitan (not quite sure when this was introduced).