AppleScript to Link to Apple Mail Message

I’ve always like the way OmniFocus can create links to Apple Mail messages when saving an email as a task. With help from listener Jacob (@evansio), I’ve now got a script that can do that anywhere via a text expander snippet. Here’s the AppleScript:

  Returns a link to the first selected Apple Mail message
tell application "Mail"
  set _msgs to selected messages of message viewer 0
  if (_msgs is not equal to missing value) then
    set _msg to first item of _msgs
    set _msgID to do shell script "/usr/bin/python -c 'import sys, urllib; print urllib.quote(sys.argv[1])' " & (message id of _msg)

    return "message://%3C" & (_msgID) & "%3E"
  end if
end tell

Here is that script embedded in a TextExpander Snippet. I’m using the abbreviation “elink”

Screen Shot 2019-02-05 at 7.19.58 AM.png

That’s it. Once you’ve installed it, just type “elink” in any app that can take a URL and you create a link to the currently selected email message. I use it all the time in Notes and Calendar note fields but it really works anywhere. Here’s a short explanatory video.

A Case Study in Phishing

A few days ago I received this email. I thought it was an excellent example of a phishing attack. If you've never heard of it before, phishing is a process where a bad guy sends you an email that looks legitimate in hopes that you'll click on the link and give information to him that he can use to somehow screw you over or steal your money.

Here’s the email. Click to enlarge.

In this case, they've created an email that looks a lot like it came directly from Apple. It’s got the Apple Logo and the YouTube logo and, on first glance, looks official. It informs me that I’ve subscribed to YouTube Red for $149.99/month and it gives me a handy link to unsubscribe. There be the dragons. If I were to click on that link–I didn’t–it would ask me for my iTunes login or my credit card (or both), and then the bad guys would have my information. Game over.

The first tool you need in fighting Spam is common sense. YouTube Red does not cost $149.99/month, and a simple search will tell you that. If there is any question, also take a closer look at the details. The sender lists their name as “App Store” but disclosing the actual email address; it’s “”. Does that really sound like an address Apple would send you to confirm a subscription? Also, it lists "Payment Method" as "By Card", not the usual xxxx-xxxx-1234 you usually see. It also creates this sense of urgency, explaining I'm on a free trial but I will be charged $150 in just two days if I don't act. While I can see how this email may fool some people, on the barest scrutiny, it starts looking shady.

Screen Shot 2018-02-28 at 9.27.27 AM.png

If you ever find yourself tempted to click on any link in an email that involves a problem or access to any of your online accounts, stop and think for a moment. Then go to the source website itself and check. In this case, logging onto my iTunes account would show that I have not, nor have I ever, signed up for a YouTube Red subscription.

Finally, there’s nothing wrong with proving yourself wrong on this stuff. I recently got a “credit card expired” email from Squarespace. Rather than clicking on the link, I went and logged into my account and discovered that my credit card had, in fact, expired. Better safe than sorry.

Want to learn more? I wrote a book about email.

The Email Diet

Screen Shot 2018-01-23 at 3.22.44 PM.png

With the start of a new year, I’m looking at new workflows, this year even more than usual. I’m disappointed that my latest iBook didn’t get released last year and am now looking for ways to get rid of some of the obstacles that got in my way.

One of the biggest obstacles is email. Because I’m “out there”, I get a lot of email. I particularly like reading and replying to email from listeners and readers. Indeed, I think I like it too much. I can start replying to MacSparky email and then look up to find that three hours just disappeared from the day. Moreover, I realized that I had turned my self-image about replying to most of my email into a liability. If I want to get a book released, I simply can't do that anymore.

To combat that, I have now put myself on a strict email diet. I’ve set aside 30 minutes a day to process email. That’s it. Within 30 minutes I can always deal with the most urgent and some of the not-so-urgent email sitting in my box. I cannot, however, deal with all email. Every day I give it 30 minutes, and then I get back to work. I realize this isn’t ideal, but it’s a lot better than letting email take over my life.

At this point, I’m considering this an experiment, not a permanent practice. I’m just a few weeks in, but I already see benefits of this email diet. Over the long term, I realize this means I’m not going to be able to answer every email that comes to me. That may just end up being the way things are. If I have to choose between being a guy who no longer publishes books or a guy who doesn’t reply to every single email he receives, I think I know which one I would prefer.

The Perils of Your Own Mail Servers

I was at a professional gathering recently when the subject of email security came up. I was surrounded by a group of lawyers that knew next-to-nothing about technology and it made me curious about their thoughts on email servers. Going around the room, I found that just about everyone was maintaining their own email servers because they felt it was “safer”. There is this bias when it comes to data that somehow privately owned servers are safer despite the fact they are connected to the same Internet populated with the same bad guys everybody else is facing.

While I think there may be some private servers out there that are as well protected as the more reputable email providers, I think that is the exception, not the rule. My impression is that most of these private servers are instead on aging Dell box in a closet connected to the Internet that may (or may not) have the most recent security patches installed and may (or may not) have an IT person baby-sitting it once in awhile. I think there is this impression that despite this lackluster security, they are somehow safer than email services that have full time professional staff holding the barbarians at the gate 24/7. As the Democratic party found out, they’re not.

Yesterday, John Gruber linked to an article by Josephine Wolff that agreed.

The DNC is never going to be the equal of these companies employing thousands of engineers and managing millions of email accounts when it comes to security, so perhaps it should stop trying and let the experts take over.

If you’re running your company’s email on a private server and haven’t been compromised (or at least not aware of being compromised), there’s a good chance that the reason for your good fortune is not because of your security but instead the fact that you are not as juicy of a target as the DNC. Maybe it’s time to reconsider.

Killing the Email Action Folder

For years now I’ve kept an “action” folder with all of my email accounts. This was particularly useful before I started deferring email with services like SaneBox. However, as of late, the “action” folder has turned into some sort of email purgatory for me. I haven’t been cleaning it out regularly and instead find myself letting things linger in there much too long.

A few weeks ago I was reminding myself to do a better job of clearing out the action folder when I got thinking about whether I even needed it any longer. My email is already filtered to put MacSparky “feedback” email into a particular folder and stuff that’s not quite as important into a “later” folder. Why do I need another place to put email?

Add to this the fact that I have pretty granular deferred email folders and it occurred to me that my new “action” folder is deferring email three hours or until tomorrow. In hindsight, that’s probably why I’ve been doing such a lousy job of cleaning out the action folder.

Anyway, as of a few weeks ago I removed all of the action folders from all of my email accounts. For the MacSparky email account, I’ve now got the following:


This is the place were the most important stuff arrives every day. This is the one I check several times a day.


This is a SaneBox automated folder. SaneBox puts email in there that it doesn’t think is as important as other email that is inbox worthy.


This is another SaneBox automated folder that takes feedback from the podcast, books, and this blog. It’s spooky how good the service is at figuring this out.


This is another filtered SaneBox folder that yanks catalog sales and other marketing email out of my inbox.

Deferred Folders

I’ve got deferred folders for three hours, tomorrow, two days, and seven days.

Spam and Blackhole

I’ve got folders that capture spam and the SaneBox blackhole for spam that gets through.


The place or email goes to sleep, a long time.

The interesting thing about all of this is that except for the archive, none of my email folders are manually sorted. Email arrives and gets automatically sorted. While I may occasionally reclassify an email to a different folder or defer it, there is no longer a process where I must open the inbox and manually file email to different places.

It’s probably too early to tell if I have deleted my action folder for good but after two weeks I can tell you that I’m not missing it. It feels as if I’m doing better at keeping up and it’s nice having one less place to routinely clean. I’ll check back in on this in a month or two.

(I've made references to SaneBox, an occasional sponsor of this blog, in this post because that's the service I use. There are others and even some apps that can also defer email.)

Deferred Email

I’ve talked and written before about deferring email. If you’ve never heard of it before, deferring email is the process of making your email disappear for a certain amount of time (usually days) or until a certain date in the future. Some applications do this by putting it in a hidden or obscure folder. SaneBox does it at the server level so it works in any application. Either way, on the designated day or after the set defer period, the email comes back to you.

I made fun of deferring email when I first heard of it. It seemed dishonest and gimmicky. However when I tried it out, I quickly became a believer. There’s a lot of email that can stand be putting off for a little bit of time but isn’t worth the extra work and baggage that come with adding it to your OmniFocus or other task manager database. In that case, deferring email really works.

When you’ve got a good email deferment system in place, you get used to seeing an empty inbox so when something shows up, you take it seriously. Simply leaving emails in your inbox (or for that matter any other email box box) results in you getting used to having a bunch of unanswered email and, in my case, malaise and despair. I’m much happier putting an email off for two days and getting it out of my sight than having to see it there every time I open my mail client. Maybe this is just psychology, but it works.

I wrote a little bit about deferred email in this week’s ad spot for SaneBox. Several people have written in asking me exactly how I set up my SaneBox defer folders. Here they are:

There is no rocket science involved here. Since going out on my own, Saturdays and Mondays are no longer as significant as they once were. I’m always working. As a result, I set up the defer folders not on specific days of the week but instead length of delay.

3 Hours

I use this one for something that comes in that I need to look at today but can’t look at right now. I use this more than you’d think.

1 Day

This one is my pressure valve. When I can’t get to it today but it is something I’ll need to deal with soon, it goes here.

2 Days

This one comes in handy when I’m waiting for something to happen. Quite often someone will ask me a question in an email and its not quite yet time for me to respond. I’m either waiting for another piece of information from someone else or haven’t had time to do whatever is needed to respond. Two days seems like the sweet spot to defer those emails. When it shows back up in a few days I usually have the answer or light a fire to get the answer.

5 Days

This is the one I use the least. In order for an email to fall into this box it needs to be both of low importance and low urgency. Things that I’m putting off five days usually get their own OmniFocus task but once in a while something falls into that area where it’s not worth an OmniFocus task and I still want to keep it in play. 

Like I said earlier, there are apps that can accommodate these deferred emails or you can use a service like SaneBox. If the volume of email is giving you trouble, I’d recommend giving deferred email a try. I use it on my legal, MacSparky, and personal accounts and, at this point, can’t imagine going back. Also, if you'd like to learn more about email, I know of a pretty good book.

Email Version 1.1 Ships

Back when I was doing traditional print books, it made me nuts that something would change a week after my book shipped and there was nothing I could do about it. One of the things I love about publishing my books through the iBookstore is the ability to update them. This lets me fix mistakes and add new content.

Email version 1.1 is now available for download. If you bought it in the iBookstore, you should see the update icon in your iBooks app. It’s a big download so make sure you’re on WiFi and have some time on your hands.

I’m still finishing up the custom PDF version of Email 1.1. That will be going up this weekend.

A partial list of the updates include the following:

  • Better controls on the audio interviews
  • Fixed misguided confusion between carbon paper and mimeograph
  • Fixed Screencast 4.20
  • Changed the recommended write order
  • Converted Email Port list into a Table
  • Added Apple Mail archive keyboard combination
  • Rewrote the description of MailMate based on recent developments
  • Added additional screenshots to the Outlook Gallery
  • Added explanation of yearly archives

Speaking of udpates, version 1.4 of Paperless and version 1.2 of Markdown are both nearly done and will ship in January. These updates will include new screencasts, content, and other bits of love and affection.

Using Keyboard Shortcuts to Search Apple Mail

When I was on Brett Terpstra's Systematic podcast this week, we both bemoaned the inability to change search token criteria without using the mouse. Turns out we were both wrong. You can. The key shortcuts are:

Option-Command-F to get in the Apple Mail search bar (We got that one right).

Up Arrow, Down Arrow, Return to select a name.

Shift-Left Arrow to get into the search token selections, like To, From, Any.

Below is a 20 second screencast demonstrating it with 100% more banjo than anything I've ever made before. Thanks listener Thomas for the tip.

MacCast and MacVoices Appearances

Two of my favorite podcasts are Adam Christianson's MacCast and Chuck Joiner's MacVoices.

The MacCast was the first legitimate Mac podcast. Adam has been producing his show with his pleasant mix of news and tips for years. I joined Adam to talk about the Email Field Guide and my experiences with iBooks and self publishing.

Chuck Joiner is the James Lipton of the Mac community with his regular interviews of Mac and Apple luminaries. Chuck lowered his standards to let me on the show this week to also talk about Email. I feel privileged to be on both of these shows. 

More on the Email Field Guide

Screenshot 2013-11-14 11.17.30.png

The initial reception for the new Email Field Guide has been fantastic. I’ve already received some great emails from readers explaining how the book has changed their game and feedback like that pushes every single one of my buttons.

There is an error in the book with respect to Screencast 4.20. I’ve posted the missing screencast on Vimeo and I’ve got it at the bottom of this post. I’ll fix this problem with the 1.1 update that will ship in December. If you haven’t bought the book, watch the screencast anyway so you can get an idea of its content. There are 36 separate screencasts in the book showing how to use different email technologies.

Over the weekend, the Mac Power Users published a new episode about email. I promise it’s not a one hour commercial for the book but instead some real practical tips for making email easier.

I honestly believe the MacSparky Field Guides are some of the best work I’ve done in my life. Thank you again everyone for supporting me in this.

The Email Field Guide

I just published the fourth MacSparky Field Guide. This one is all about email. I've spent most of the past year looking very closely at email and how it works. This new book explains the best methods, technologies, services, apps, and workflows to make email work for you.

There are over 300 pages and nearly 1.5 hours of video screencasts and 200 screenshots as I walk you through. I've also included several audio interviews with friends including Serenity Caldwell, Rob Corddry, Merlin Mann, Fraser Speirs, Jeff Taekman, Aisha Tyler, David Wain, and Gabe Weatherhead, that provide even more perspective on the best ways to tackle email.

The book features a new craftsman-style design and is illustrated by Mike Rohde. In a lot of ways, this book feels like the culmination of everything I've learned along the way. I'm really proud of this book and I hope you enjoy reading it as much as I enjoyed creating it. It is available in the iBooks Store and PDF for $9.99.


Buy the iBooks Store Version of the Email Field Guide


Buy the PDF Version of the Email Field Guide


Visit the Website