I’m not one of those highly organized, Getting Things Done people with OmniFocus tasks and due dates that I actually achieve. I use a hodgepodge of techniques that seem to revolve around my email. I know, that made many of you cringe, but I’ve got a cool trick that is starting to help me connect relevant emails to my tasks.
The Problem to be Solved
Let’s start with a pretty simple example. We all order a lot of stuff online these days. I find myself losing track of what I’ve ordered, when I’ve ordered it, where I ordered something from, when I was supposed to get it, and forget all about knowing my order number.
About a year ago I started a list that called “Ordered Items” in Microsoft To Do (the love child of Wunderlist). When I order something, I create a new item in To Do. Every item in To Do can have steps within it, reminders, due dates, file attachments, and free-form notes.
So let’s say I order some IKEA shelves. I create an item in To Do and then go to the email confirmation and copy the information out of it, like the order number and delivery date so if it never shows up I can check up on it. Often I need more detail from the email at a later date, and I’d have to hunt through my 70,852 saved emails to find it.
I’ve found a better solution for this, and it’s pretty nerdy which makes me like it even better. It’s called deep linking. I don’t remember how I discovered the concept but I learned the super nerdy details about deep linking from a blog post at nshipster.com/….
The main thing you need to know is that every email message you receive has a unique message-id associated with it. Given that unique message-id and a bit of reformatting, we can create a link to plop in anywhere that when clicked will launch the email in Mail.app.
Revealing the Message-ID
The first thing we need to do is to tell Mail that we want to be able to see the message-ID header when viewing our emails. We only have to do this once.
To reveal the message-ids on your emails, open up Mail’s preferences, and select the Viewing tab. You’ll find an option to Show message headers with a dropdown next to it which probably says Default. Select Custom from the dropdown, and then in the little window that comes up, tap the plus button and then type “Message-ID” and select OK, and close Mail Preferences.
Now when you look at your email messages, along with who they’re from, the subject, and who the message was to, you’ll see a long, gloppy-looking message-ID:
The format of the message-ID is interesting. It’s enclosed in angle brackets, it starts with a lot of numerical digits separated by dots, it’s got an @ symbol in the middle, and it ends with the domain that sent it, such as ikea.com. This unique identifier is what we’ll be using to link to an email, and luckily we don’t need to understand much about it to use it.
Reformatting the Message-ID
While this message-ID has the information we need, in order to actually use this crazy looking message-ID, we need to reformat it a bit to make it a deep link.
You know how web URLs start with
https://`? The format of a deep link starts withmessage://
. So far that’s not too scary. The next part is a little weirder. Certain symbols can’t be understood by computers, so we have what are called ASCII codes for non-printable characters. The reason I bring up this arcane topic is that we need to replace the angle brackets in our message-ID with their ASCII codes for them to be recognized in the deep link. The left angle bracket (the one that looks like a less-than symbol) will be replaced with%3c
and the right angle bracket (greater than symbol) will be replaced with%3e`.
So now our final format for the deep link is:
I wonder how many people stopped listening when I got to the ASCII code for non-printable characters? If you’re still with me, hang in there because you’re not going to have to do any of this by hand.
TextExpander to the Rescue
I played with this a bit and realized that I was never going to remember the ASCII codes and the formatting of
message://, so I turned to one of my favorite tools for help, TextExpander.
TextExpander at its most basic will spit out a snippet of text when you type the abbreviation you assigned for it, but it can do a lot more than that. One of the things it can do is embed your clipboard in the snippet it spits out, and we’ll use that feature to create our deep link automatically.
In TextExpander I simply typed in
message://%3c , then clicked the little keyboard symbol to bring up keyboard macros, and selected Clipboard, then followed that with
I’ve managed to make that sound super complicated, but it took maybe 30 seconds to accomplish. I chose the letters
msg; to trigger my snippet of text and I was ready to go.
All of the heavy lifting is over now. To use my fancy new TextExpander snippet to deep link to an email, the process is simple. In the email to which I want to link, I copy the message-ID without the angle brackets. I switch to wherever I need to put the deep link, in my example this would be in my To Do List. I type my abbreviation, and the deep link splats into the open text field. It’s ugly as sin (as my father would say), but it’s a real link and when I click it, Mail launches directly to the order email from IKEA. Mission accomplished and all I need to remember is my TextExpander abbreviation.
Remember that this whole thing doesn’t have anything to do with Microsoft To Do, that’s just one of the places I use it. I got an email from someone telling me they wanted to meet and included a lot of important information in the email. I copied the Message-ID from the email and then used my TextExpander abbreviation to paste it as a deep link into a Calendar event. Unlike To Do, when you use this in Apple’s Calendar app, it converts the gloppy message:// etc into “Show in Mail…” which looks great and is much less confusing.
Now that I have this working, I’m finding lots of places where it’s handy to drop in a link to an email so I can connect information together and not have to go hunting for it later.
I use this trick often but not quite often enough to remember whether or not I’m supposed to copy the angle brackets. I’m not sure why this works, but if you do copy the angle brackets, they just get ignored and the deep link still works!
Can’t Keyboard Maestro Do This?
At least some of you are yelling into your devices that I could have used Keyboard Maestro for this instead of TextExpander, and you’d be absolutely correct. I’m not as good at Keyboard Maestro yet as I am with TextExpander, but I got it to work. Remember we start with the message-ID copied into the clipboard, so the steps I put into Keyboard Maestro are:
- Set variable messageID to the system clipboard
- Prepend the variable messageID with
- Append the variable messageID with
- Set the system clipboard to the variable MessageID
Just to keep it as much like the TextExpander snippet as possible, I set the Keyboard Maestro trigger to be a text string and in this case, I chose
mid;. Keyboard Maestro doesn’t work quite the same as TextExpander so after I typed the trigger and it pasted in my newly-formed deep link, the trigger text string was still there. Luckily Keyboard Maestro offered to simulate deleting the characters of the trigger before executing which made my macro work properly.
Now I can select the message-ID from Mail, type my text string and the deep link is pasted wherever I want it.
I bet there’s a more elegant way to write the macro in Keyboard Maestro and I’m sure Mike Price will write an improved version when he hears how I did it. It will be awesome and filled with funny comments too. But my method does work so I’m happy.
I’m sure at least 90% of you think I’m nuts that this is a time-saver, and too nerdy for you, but I use this pretty often and I love the efficiency of it. Now that I’ve spoon-fed it to you with screenshots using two different tools, why not give it a try? The worst thing that can happen is that you love it.