{"id":24318,"date":"2021-08-25T07:45:59","date_gmt":"2021-08-25T14:45:59","guid":{"rendered":"https:\/\/www.podfeet.com\/blog\/?p=24318"},"modified":"2021-12-09T15:31:38","modified_gmt":"2021-12-09T23:31:38","slug":"deep-links","status":"publish","type":"post","link":"https:\/\/www.podfeet.com\/blog\/2021\/08\/deep-links\/","title":{"rendered":"Why Would You Want to Create a Deep Link to an Email?"},"content":{"rendered":"<p>I\u2019m 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\u2019ve got a cool trick that is starting to help me connect relevant emails to my tasks.<\/p>\n<h2>The Problem to be Solved<\/h2>\n<p>Let\u2019s start with a pretty simple example. We all order a <em>lot<\/em> of stuff online these days.  I find myself losing track of what I\u2019ve ordered, when I\u2019ve ordered it, where I ordered something from, when I was supposed to get it, and forget all about knowing my order number.<\/p>\n<p>About a year ago I started a list that called \u201cOrdered Items\u201d in <a href=\"https:\/\/todo.microsoft.com\/tasks\/\" target=\"_blank\" rel=\"noopener\">Microsoft To Do<\/a> (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.<\/p>\n<p>So let\u2019s 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\u2019d have to hunt through my 70,852 saved emails to find it.<\/p>\n<h2>Deep Linking<\/h2>\n<p>I\u2019ve found a better solution for this, and it\u2019s pretty nerdy which makes me like it even better. It\u2019s called deep linking. I don&#8217;t remember how I discovered the concept but I learned the super nerdy details about deep linking from a blog post at <a href=\"https:\/\/nshipster.com\/message-id\" target=\"%5Fblank\" rel=\"noopener\">nshipster.com\/&#8230;<\/a>.<\/p>\n<p>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.<\/p>\n<h2>Revealing the Message-ID<\/h2>\n<p>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.<\/p>\n<p>To reveal the message-ids on your emails, open up Mail\u2019s preferences, and select the Viewing tab.  You\u2019ll 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 \u201cMessage-ID\u201d and select OK, and close Mail Preferences.<\/p>\n<figure style=\"float: center; margin: 10px\"><img decoding=\"async\" src=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2021\/08\/Mail-Preferences-Show-Message-ID.png\" alt=\"Mail Preferences Show Message ID\" title=\"#title#\" width=\"400 \" height=\"\"><figcaption style=\"text-align:center\">Mail Preferences Show Message ID<\/figcaption><\/figure>\n<figure style=\"float: center; margin: 10px\"><img decoding=\"async\" src=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2021\/08\/Mail-Preferences-Add-Message-ID.png\" alt=\"Mail Preferences Add Message ID\" title=\"#title#\" width=\"400 \" height=\"\"><figcaption style=\"text-align:center\">Mail Preferences Add Message ID<\/figcaption><\/figure>\n<p>Now when you look at your email messages, along with who they\u2019re from, the subject, and who the message was to, you\u2019ll see a long, gloppy-looking message-ID:<\/p>\n<p><code>&lt;1744271175.415770.1629846760289@itseelm-lx42030.ikea.com&gt;<\/code><\/p>\n<figure style=\"float: left; margin-right: 10px\"><img decoding=\"async\" src=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2021\/08\/Mail-Message-Showing-Message-ID.png\" alt=\"Mail Message Showing Message ID\" title=\"#title#\" width=\"400 \" height=\"\"><figcaption style=\"text-align:center\"><\/figcaption><\/figure>\n<p>The format of the message-ID is interesting. It\u2019s enclosed in angle brackets, it starts with a <em>lot<\/em> of numerical digits separated by dots, it\u2019s 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&#8217;ll be using to link to an email, and luckily we don&#8217;t need to understand much about it to use it.<\/p>\n<h2>Reformatting the Message-ID<\/h2>\n<p>While this message-ID has the information we need, in order to actually <em>use<\/em> this crazy looking message-ID, we need to reformat it a bit to make it a deep link.<\/p>\n<p>You know how web URLs start with <code>https:\/\/<\/code>? The format of a deep link starts with  <code>message:\/\/<\/code>.  So far that\u2019s not too scary. The next part is a little weirder. Certain symbols can\u2019t 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 <code>%3c<\/code> and the right angle bracket (greater than symbol) will be replaced with <code>%3e<\/code>.<\/p>\n<p>So now our final format for the deep link is:<\/p>\n<p><code>message:\/\/%3c<\/code>1744271175.415770.1629846760289@itseelm-lx42030.ikea.com<code>%3e<\/code><\/p>\n<p>I wonder how many people stopped listening when I got to the ASCII code for non-printable characters? If you\u2019re still with me, hang in there because you&#8217;re not going to have to do any of this by hand.<\/p>\n<h2>TextExpander to the Rescue<\/h2>\n<figure style=\"float: right; margin-left: 10px\"><img decoding=\"async\" src=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2021\/08\/TextExpander-Snippet-for-Deep-Link.png\" alt=\"TextExpander Snippet for Deep Link\" title=\"#title#\" width=\"500 \" height=\"\"><figcaption style=\"text-align:center\">TextExpander Snippet for Deep Link<\/figcaption><\/figure>\n<p>I played with this a bit and realized that I was never going to remember the ASCII codes and the formatting of <code>message:\/\/<\/code>, so I turned to one of my favorite tools for help, <a href=\"https:\/\/textexpander.com\" target=\"_blank\" rel=\"noopener\">TextExpander<\/a>.<\/p>\n<p>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&#8217;ll use that feature to create our deep link automatically.<\/p>\n<figure style=\"float: left; margin-right: 10px\"><img decoding=\"async\" src=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2021\/08\/TextExpander-Keyboard-Macro-for-Clipboard.png\" alt=\"TextExpander Keyboard Macro for Clipboard\" title=\"#title#\" width=\"250 \" height=\"188\"><figcaption style=\"text-align:center\">Insert Clipboard in TextExpander Snippet<\/figcaption><\/figure>\n<p>In TextExpander I simply typed in <code>message:\/\/%3c<\/code> , then clicked the little keyboard symbol to bring up keyboard macros, and selected Clipboard, then followed that with <code>%3e<\/code>.<\/p>\n<p>I\u2019ve managed to make that sound super complicated, but it took maybe 30 seconds to accomplish.  I chose the letters <code>msg;<\/code> to trigger my snippet of text and I was ready to go.<\/p>\n<h2>Usage<\/h2>\n<figure style=\"float: right; margin-left: 10px\"><img decoding=\"async\" src=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2021\/08\/Deep-Link-in-To-Do.png\" alt=\"Deep Link in To Do\" title=\"#title#\" width=\"350 \" height=\"316\"><figcaption style=\"text-align:center\">Deep Link in To Do<\/figcaption><\/figure>\n<p>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\u2019s ugly as sin (as my father would say), but it\u2019s 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.<\/p>\n<p>Remember that this whole thing doesn\u2019t have anything to do with Microsoft To Do, that\u2019s 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\u2019s Calendar app, it converts the gloppy message:\/\/ etc into \u201cShow in Mail\u2026\u201d which looks great and is much less confusing.<\/p>\n<figure style=\"float: left; margin-right: 10px\"><img decoding=\"async\" src=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2021\/08\/Deep-Link-In-Calendar-Event.png\" alt=\"Deep Link In Calendar Event\" title=\"#title#\" width=\"275 \" height=\"294\"><figcaption style=\"text-align:center\">Deep Link In Calendar Event<\/figcaption><\/figure>\n<p>Now that I have this working, I\u2019m finding lots of places where it\u2019s handy to drop in a link to an email so I can connect information together and not have to go hunting for it later.<\/p>\n<p>I use this trick often but not quite often enough to remember whether or not I&#8217;m supposed to copy the angle brackets.  I&#8217;m not sure why this works, but if you do copy the angle brackets, they just get ignored and the deep link still works!<\/p>\n<h2>Can\u2019t Keyboard Maestro Do This?<\/h2>\n<figure style=\"float: right; margin-left: 10px\"><img decoding=\"async\" src=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2021\/08\/Deep-Link-Conversion-in-Keyboard-Maestro.png\" alt=\"Deep Link Conversion in Keyboard Maestro\" title=\"#title#\" width=\"451 \" height=\"600\"><figcaption style=\"text-align:center\">Deep Link Conversion in Keyboard Maestro<\/figcaption><\/figure>\n<p>At least some of you are yelling into your devices that I could have used <a href=\"https:\/\/www.keyboardmaestro.com\/main\/\" target=\"_blank\" rel=\"noopener\">Keyboard Maestro<\/a> for this instead of TextExpander, and you&#8217;d be absolutely correct.  I\u2019m 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:<\/p>\n<ol>\n<li>Set variable messageID to the system clipboard<\/li>\n<li>Prepend the variable messageID with <code>message:\/\/%3c<\/code><\/li>\n<li>Append the variable messageID with <code>%3e<\/code><\/li>\n<li>Set the system clipboard to the variable MessageID<\/li>\n<li>Paste<\/li>\n<\/ol>\n<p>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 <code>mid;<\/code>.  Keyboard Maestro doesn\u2019t 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.<\/p>\n<p>Now I can select the message-ID from Mail, type my text string and the deep link is pasted wherever I want it.<\/p>\n<p>I bet there\u2019s a more elegant way to write the macro in Keyboard Maestro and I\u2019m 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\u2019m happy.<\/p>\n<h2>Bottom Line<\/h2>\n<p>I\u2019m sure at least 90% of you think I\u2019m 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\u2019ve 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.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I\u2019m 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\u2019ve got a cool trick that is starting to help me connect [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":24312,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[147],"tags":[1821,4762,4760,1830,854,4761,3651,258,3296,3295],"class_list":["post-24318","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog-posts","tag-automation","tag-calendar-event","tag-deep-links","tag-keyboard-maestro","tag-mail","tag-message-id","tag-microsoft-to-do","tag-textexpander","tag-to-do-2","tag-to-do-list"],"jetpack_featured_media_url":"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2021\/08\/Mail-Message-Showing-Message-ID.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/posts\/24318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/comments?post=24318"}],"version-history":[{"count":9,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/posts\/24318\/revisions"}],"predecessor-version":[{"id":24895,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/posts\/24318\/revisions\/24895"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/media\/24312"}],"wp:attachment":[{"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/media?parent=24318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/categories?post=24318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/tags?post=24318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}