Keyboard Maestro: The Key To Unlocking Your Computer

The Techie Scheky series offers tips and tactics for being more productive and creative through technology (especially with a Mac).

After laying some basic groundwork on the joy that is keyboard shortcuts, I want to take things to the next level and hopefully help you step up your game. While built-in shortcuts are great, they are limited. They usually only handle a single action, they are often limited to a single app and, annoyingly, the same functions tend to differ from application to application. Thankfully for us, we have a tool to solve each and every one of these problems in Keyboard Maestro, an app that manages to be powerful while remaining easy for even a novice to use.

Keyboard Maestro is a lot of things. It’s an application switcher, a clipboard history manager, it can mimic features of applications such as LaunchBar and TextExpander and it helps you create your own shortcuts. I tend to shy away from swiss army knives (the wave of apps that try do everything). While Keyboard Maestro risks falling into this territory, it was easy enough to shut off things like the app switcher and clipboard history to hone in on where I feel this app really shines: in allowing you to create your own macros and assign them to triggers like keyboard shortcuts that can be used across any and all of the applications on your system (or that can be tied to specific applications).

Any geek, especially those who dabble in the productivity space, tend to think in workflows. We examine how we do the things that we do. This is usually a three-step process: (1) consider your work, (2) define the most efficient steps to accomplish it and (3) automate the hell out of it. Simply put, Keyboard Maestro removes friction and reduces the steps needed to really get things done. There are several ways to accomplish this. You can find specific apps or you can use geeky things such as Services or Automator). But so far, I am yet to find an easier way for a novice to start automating their workflows than Keyboard Maestro.

It can be a challenge to explain what Keyboard Maestro does, as it is capable of such a range of tasks. For the sake of simplicity (and to be merciful to both of you reading this), let’s focus in on the automating of workflows. Two things you are going to want to consider when creating a macro are the trigger and the actions. There are a variety of triggers that can set off your actions. A specific time, starting up your system or a specific act or hotkeys1 can be used to kick off just about any set of actions you can string together.

While you can really use this everywhere and and anywhere, I find I use it most for writing and email management. Here are a few quick examples:

Email: I use Disqus to manage the comments on this blog which allows me to reply by email. When I usually reply to messages, my email signature gets added to the end of every message. I’m not looking to post that all over the web so I would always highlight any undesired text, hit the delete key and start typing my reply. Now, I’ve created a macro that quickly highlights and deletes the signature for me allowing me to jump into my response and move on with my day a little bit faster. Another pet peeve of mine is Gmail’s reluctance to allow you to add a label to a new outgoing message. While I really only use one it is central to the way I work. Any message awaiting a reply gets marked @Waiting, this enables me to stay on top of all messages that are awaiting a reply. Gmails current limitation forces me to send the message, then go to my sent folder, select the message I just sent, tag it and return to the inbox. This has now been automated and with a single keystroke, the message is sent, labeled and I am back in my inbox.

Writing: Pretty much everything I write is in Markdown, a format that keeps everything I write future proof, easy to read and ready to be converted to HTML for posting to the web. While certain apps like Byword have excellent built in Markdown shortcuts, I wanted to have a set of keys that worked universally across all of my writing applications. It doesn’t matter if I am working in nvALT, Byword, Scrivener or any other app I happen to be playing with, Keyboard Maestro made it easy to create an array of keyboard shortcuts for formatting in Markdown. I also use it to quickly move text around my system for posting. Right before posting to my site, articles ends up in nvALT for final editing and formatting. From there, I copy the text and tag the post as “Posted”. After that, the text gets pasted into MarsEdit, I separate the title from the rest of the post and send it off to my blog. It once took several steps and as you can see from the video below, they now they all happen by at the touch of a single shortcut.

Here’s a screenshot of the macro for those who are geeky enough to care.

While all of this sounds complicated, these macros are actually extremely easy to create. There are two ways to create new ones, manually or by recording your actions. The manual process comes in handy when you want to have things like pop ups for filling in text that will vary from use-to-use, but most of the time, the record feature will be the best way to go. You create a new macro, hit record, do exactly what you want to do. Keyboard Maestro tracks your steps and turns them into a new macro. Once you stop recording you may need to remove a few extra steps at the beginning and the end (as getting in and out of the app are recorded), but once that’s done, all you need to do is set your trigger and save the macro.

The learning curve here is a little steeper than most apps, but the payoff is worth it. Once you really dive in and start automating nonsense, you’ll see the difference that Keyboard Maestro can make. It helps you make your computer your own by enabling you to do the little things you always wished it did. It lets you automate tedious repetitive steps with ease and keeps your focus on the thing that matters most, the work you want and need to achieve.

To learn more, subscribe for free by Email or RSS to automatically receive future Techie Scheky posts from MichaelSchechter.me.

  1. A fancy name for keyboard shortcuts. []
  • http://bluechile.net Charles

    I’m just getting started with Markdown.  I tend to spend more time doing edits and rewrites than I do on the original draft. I find that editing a heavily  Markdown annotated file (especially one with a lot of links) to be more difficult than editing a WYSIWYG file. Mixing code and text is OK for writing but, for me, hugely distracting when trying to edit.  It would be nice if editing in Preview Mode could be done but I’ve seen no tools for that yet.  If you’ve got any suggestions on how to deal with this, please let me know.

    • http://michaelschechter.me MSchechter

      The problem with WYSIWYG (at least for me) is 1) portability as I do a tremendous amount of writing on the go 2) future proofing as you never know which file formats are going to stick around and to a lesser extent 3) Crufty HTML.

      Two things that have helped me a lot are Byword and one of Brett Terpstra’s services. Byword has great built in Markdown features to hide the formatting and bring the text to the forefront. I also significantly prefer reference links to inline links, but this has always been a bit of a challenge considering the post is already written. Terpstra created a great service that converts all of the inline links to reference. It makes things far easier for editing. You can find it here: http://brettterpstra.com/auto-convert-your-inline-markdown-links-to-references/

      • http://bluechile.net Charles

        Thanks Michael,  That Byword feature sounds like just what I’m looking for. What’s one more text editor? I’d rather avoid reference links if possible, though I can see how they help visually.  I’m not a particularly structured writer (or thinker for that matter) and anything smacking of footnotes is not for me.  Great tip on Byword.

        • http://michaelschechter.me MSchechter

          I bounce back and fourth between nvALT and Byword. nv is great for quick capture and brain dump, where Byword is just a better environment for writing and for Markdown. There are tons of other options, like iaWriter, Grandview, etc. but I find I have everything I need between those two apps. They also play really nicely together. I talk about it here: http://michaelschechter.me/going-bi-for-byword/

  • http://twitter.com/yuvizalkow Yuvi Zalkow

    Damn! That was great, Michael. Very nicely articulated. And your example is really great too. (Even more so after looking at the macro and realizing how many steps it is seamlessly doing for you.) Beautifully done…

    Although I’m beginning to get really really into Keyboard Maestro as well, there is a step I take sometimes that is between your beginner post yesterday (i.e. using keyboard shortcuts) and today’s advanced Keyboard Maestro post… And that is to set up my own keyboard shortcuts for any menu items that don’t have shortcuts built-in (or don’t have shortcuts that I like)… You can do that by going to “System Preferences > Keyboard”. Click the “Keyboard Shortcuts” tab, select “Application Shortcuts” from the list on the left and then add any menu items that you want keyboard shortcuts for.

    Oh also… there’s an even geekier thing I do with my favorite Keyboard Maestro macros (or even for regular keyboard shortcuts) –> I use Better Touch Tool to create trackpad gestures for them. For example, I use a four finger tap in each application to perform my most needed macro or shortcut. I find that a quick tap on a laptop trackpad is even quicker than certain key combinations.

    • http://michaelschechter.me MSchechter

      Thanks! It took a while to try and make it manageable, but I think I came close :)

      Glad I decided to add in the picture last minute. I liked how the video came out, but don’t think it showed just how many steps the macro actually covers.

      I was going to touch on the keyboard settings panel, but then you’re getting into things like services and then I’m talking about Brett Terpstra and the next thing you know, I’ve woken up a week later in Vegas. If you are playing with those, you really want to pick up his keyboard bindings packet… there is some seriously good stuff in there for text manipulations: http://brettterpstra.com/keybinding-madness/

      Looks like I’ll be playing with Better Touch at some point soon!

  • http://bakarichavanu.net Bakari Chavanu

    Great to see another writer using Keyboard Maestro. I have a similar macro that I use with MarsEdit that copies the title of my blog/article post in ME and then launches the Send to Blog. From there it switches over to Firefox and opens it to WordPress where the article is sent; next, it switches to Safari and launches my Google Calendar site so I can paste the title of the article into my calendar, and finally it merges all my open Safari windows into one, so I can have a cleaner working space to work again.  

    KM saves me from performing these types of redundant steps in many of the computer workflows. I used to be a QuicKeys user, but since it hasn’t been updated for Lion, I switched over to KM. I’d be a very unhappy Mac user without KM and other automator programs. 

    • http://michaelschechter.me MSchechter

      Holy awesome! Your macro kicks my macro’s ass! I’ve thought about taking it all the way to the browser (especially now that my All-in-one SEO fields broke), but havent yet. What do you do when you want to add images through ME? Do you have one macro that takes it to ME and then another that does the brower workflows? Also, why Firefox and Safari rather than doing it all in Safari?

      Sorry to pepper you with questions, just always great to pick up some new tricks!

      • http://bakarichavanu.net Bakari Chavanu

        For some reason WordPress doesn’t work well for me in Safari, so i started opening it in Firefox over a year ago. It probably works fine now, but I’m just been too lazy to switch back. 

        As for adding images to ME, I don’t think it can’t be done because if you copy an image only the file name gets posted in ME. I pretty sure there’s some sore of work-a-around for it, though.  

        By the way, I just posted how-to article about turning a KM macro into a app droplet. You can read it here: http://macautomationtips.wordpress.com/2011/12/12/creating-a-droplot-in-keyboard-maestro/

        I’ll continue to write other articles about using KM and other programs because I think many Mac users don’t seem to be taking advantage of these programs. 

        Let’s keep on touch and what we’re learning about KM. 

        • http://michaelschechter.me MSchechter

          Gotcha! I’m not sure I follow on ME, it completely handles the upload of the image as well. You can even tell it to send it immediately or to upload it with the post. It’s the main reason I love using ME.

          Looking forward to checking out the post and will do!

  • http://bakarichavanu.net Bakari Chavanu

    Here’s another rather long macro just give you an idea of it’s ability:

    1. I select the title of an article
    2. KM copies the selected title
    3. It then copies the URL of the webpage for the article
    4. It switches to Mailplane 
    5. Starts a new gmail email
    6. Pastes in the recipients’ addresses
    7. Tabs forward a few spaces
    8. Pastes in the title of the article in the subject line
    9. Tabs forward
    10. Pastes in the URL for the website (using previous copied text action) in the body 
    11. Does return key a few times
    12. Paste the words, “Newsworthy?”
    13. Does return key a few other times and waits for my custom message. All done in under 10 seconds. 

    Oh one more:

    1. I select word(s) in ME
    2. I click trigger and KM launches Add Link menu item
    3. KM switches to Safari–selects last window brought to front
    4. Copies URL
    5. Switches back to ME
    6. Pastes URL in Add Link window
    7. Clicks Return Done in like 7 seconds. Less clicking of keys.
    • http://michaelschechter.me MSchechter

      Amazing what that little app can do!

  • M. Connors

    Nice post Michael. Never used Keyboard Maestro. It seems quite is powerful.

     A lot of our use of writing apps and methods overlap though I am new to MarsEdit and am having issues with pasting Markdown formatted text from Byword/nvALt into MarsEdit for posting.  How and when is the text converted out of Markdown in MarsEdit? I see that you paste it in as Markdown text in the video above. Even in the preview window of MarsEdit I am not able to see the converted markdown text.I’ve contacted Daniel on this and am waiting for a reply. Feel like I’m missing something simple here.

    • http://michaelschechter.me MSchechter

      I had the same problem when I started and yes, you’re exactly right it’s one of those little things that is easy to overlook, but makes you feel silly when you find it (or at least it made me feel that way).

      Hit the preview button, then at the bottom is a drop down menu, set it to Markdown Preview. You can also go into the settings of that particular blog and set the Markdown preview as the default.

      As for posting, I use a plug in that allows me to post Markdown directly into WP. I’ll find and post the link to it later, but if you Google WordPress bbEdit Markdown it should show up as the first return.

      • M. Connors

        I’ve heard from Daniel on this. His suggestion follows: ”First, let’s solve the problem of your preview window not showing the MultiMarkdown correctly. Please review a few details:1. First, you have to select MultiMarkdown from the “Preview Filter” popup in the preview window. If you want to have it automatically selected all the time you can select it in the blog settings under Editing -> Preview Defaults.2. Second, you have to be “HTML Text” mode for markdown and other formats to work properly. Make sure you are not in “Rich” mode where everything is always treated literally.The trick then, for getting the Markdown converted to HTML before publishing, is to just switch from HTML Text to Rich Text mode before publishing. This forces MarsEdit to convert the content for the benefit of the Rich editor, which you can then just send to the blog.”I found a slightly different method based on Daniel’s that seems to honor footnotes, links, and such when converting Markdown.:1. I’ve set Markdown as my Preview Filter.2. I’ve set new posts to be edited in HTML Text3. I can now write in Markdown in Byword/nvAlt -> copy the HTML -> paste into MarsEdit -> convert to RTF and all footnotes, links, and formatting seems to convert. I can then add photos, and post to blog.

        • http://michaelschechter.me MSchechter

          That’s certainly the “right way” to do it. I prefer the fast way of sending Markdown directly into the post. This way if I ever want to edit, it’s consistent to my draft. This plugin also allows you to mix MD and HTML, so you can still add pictures, center text, etc.

          • M. Connors

            I’ll try it out too. Thanks for tracking it down and sharing.

      • M. Connors

        Sorry that last was a cluster.

        I’ve heard back from Daniel on this. His suggestion follows:

        1. First, you have to select MultiMarkdown from the “Preview Filter” popup in the preview window. If you want to have it automatically selected all the time you can select it in the blog settings under Editing -> Preview Defaults.

        2. Second, you have to be “HTML Text” mode for markdown and other formats to work properly. Make sure you are not in “Rich” mode where everything is always treated literally.

        The trick then, for getting the Markdown converted to HTML before publishing, is to just switch from HTML Text to Rich Text mode before publishing. This forces MarsEdit to convert the content for the benefit of the Rich editor, which you can then just send to the blog.

        I found a slightly different method that seems to honor footnotes, links, and such when converting Markdown.:

        1. I’ve set Markdown as my Preview Filter.

        2. I’ve set new posts to be edited in HTML Text

        3. I can now write in Markdown in Byword/nvAlt -> copy the HTML -> paste into MarsEdit -> convert to RTF and all footnotes, links, and formatting seems to convert. I can then add photos, and post to blog.

    • http://michaelschechter.me MSchechter
  • M. Connors

    Nice post Michael. Never used Keyboard Maestro. It seems quite is powerful.

     A lot of our use of writing apps and methods overlap though I am new to MarsEdit and am having issues with pasting Markdown formatted text from Byword/nvALt into MarsEdit for posting.  How and when is the text converted out of Markdown in MarsEdit? I see that you paste it in as Markdown text in the video above. Even in the preview window of MarsEdit I am not able to see the converted markdown text.I’ve contacted Daniel on this and am waiting for a reply. Feel like I’m missing something simple here.