Productivity Apps: Keyboard Maestro

keyboard_maestro_logoI’ve had this article on the back burner for almost three years now, but for the next thrilling instalment of my productivity app blogs, I’ll be turning to look at Keyboard Maestro.

Don’t let the somewhat dated website put you off, the app itself is unbelievably powerful. I have to admit to being wary when I first tried it out. The learning curve is steep, and the documentation pretty unclear – especially when compared to the other productivity apps that are available. However, after months years of sustained use, my feelings towards Keyboard Maestro have completely changed. It’s tough to get into, but so worth it. I honestly don’t know what I would do without it at this point.

So if Keyboard Maestro is so great, why did it take me so long to publish this? Well, there’s a few reasons. Firstly, there aren’t so many general use cases for Keyboard Maestro – at least not for me. Instead, it’s an app that’s best for repetitive tasks that are very specific to each user’s needs, which makes it difficult to give good examples. Secondly, it’s an app that you tend to set up and forget… before rediscovering it later on when your needs have changed, and you realise: “Oh! Keyboard Maestro could make this way easier!”. I’ve gone through that cycle a number of times, and after rediscovering just how awesome it is, I decided to finally complete this post.

What does it do?

Okay okay so Keyboard Maestro is great, but what does it actually do?. This is a good question, as it isn’t immediately obvious. Essentially, Keyboard Maestro allows you to take any task that you have to repeat, and automates it. If you’re familiar with Alfred, think of Alfred workflows, but on steroids. The key difference is that instead of having to write Applescript for every action you want to complete (which is still an option, by the way), there are a whole bunch of options baked in. Whether that’s telling the mouse to move and click on a certain point, displaying a popup message, getting an image size, filling in a field on a website, or whatever. You get a lot of control from the get go.

Keyboard Maestro Actions
Some of the ‘actions’ available.

 

The sheer power of Keyboard Maestro is also its undoing in a way. It’s easy to look at the list of actions and wonder when you will ever use any of them. The UI is not the most intuitive, and you’d be forgiven for giving up at the beginning purely on that basis alone.

If you want to carry out simple, general tasks, then there may well be a nicer app that lets you do those things. However, that isn’t the point of Keyboard Maestro. Keyboard Maestro is there to help you automate pretty much any task that you can think of.

In addition to the automation, there is a whole host of other cool features that you can do a deep dive into – such as an extensive multi clipboard manager, application switcher, and others – but for me the real glory lies in the macros.

What can it do for me?

 

One of the biggest hurdles to starting off with Keyboard Maestro is working out exactly what you’ll use it for. It takes a conscious effort to work out what tasks you could automate – which isn’t necessarily something you thought was possible beforehand. Once you do sit down and give it some attention though, you’ll soon come up with plenty. Do you have to fill out specific fields on a website more than once? Use a macro. Do you need to convert HTML to markdown? Use a macro. Need to extract URLs from a big block of text? Macro. The possibilities are endless.

As part of my job, I regularly have to review and respond to reports about different websites using a helpdesk system. Each one (generally) requires me to:

  1. Find the website URL in the e-mail and open it.
  2. Decide what to do.
  3. Note down the action taken in certain circumstances.
  4. Reply by copying a specific part of the original message, and quoting it back in a certain format before providing an appropriate response.
  5. Select a certain option to mark the issue as ‘Resolved’ or ‘On Hold’.

All of these steps are fairly straightforward, but a lot of time is taken up by clicking through the same tasks for each – even when I use a textexpander or snippet manager like Alfred. Sometimes the URLs are jumbled up and I need to fix them before opening or responding, or they are buried in huge blocks of text… etc. However, with Keyboard Maestro, I can reduce this all to a couple of key presses, with a couple of macros doing all of the following:

  1. Extracting all of the URLs from the messages, and opening them in new windows.
  2. Pasting the URLs in the correct quoted format at the top of the reply, along with the appropriate response.
  3. Adding whatever notes needed to track the action taken in a specific field.
  4. Marking the issue Resolved or On Hold as appropriate.

The only thing Keyboard Maestro doesn’t do is decide what action to take – which is just as well really, for a variety of reasons!

Like many of the examples, that one is very specific, but it demonstrates a bit of how granular and useful Keyboard Maestro macros can be – and will hopefully get you thinking about your own use cases. Here are some other more general tasks I regularly deploy macros for:

  • Inserting a URL wrapped in a href tags.
  • Pasting text with different styles of quotes depending on the situation.
  • Parsing blocks of text to extract URLs and/or e-mail addresses.
  • Getting ID numbers from long URLs.
  • Pasting items in a bulleted or numbered list automatically.
  • Filling out forms online.
  • Copying the current URL from my browser window (and doing stuff with it).

The most powerful and useful ones are those that have very specific, work related use cases. With a bit of imagination, you’ll come up with your own, so I’d encourage you to give it a bash.

Triggers

To wrap this up, I wanted to highlight one more feature of Keyboard Maestro that makes it stand out from other productivity apps. For those veterans amongst us who regularly make use of workflow improvements, it’s easy to run out of hotkey assignments, and Keyboard Maestro has a bunch of different ways to solve that problem. First off is the use of ‘palettes’, which lets you assign the same hotkey to different macros – and then select them from a menu – or to activate different hotkey sets depending on what you’re working on that day.

If you already use Alfred, Keyboard Maestro is a brilliant complement, rather than a replacement in this way too. There is a specific Alfred workflow that lets you search and trigger Keyboard Maestro macros from the Alfred search bar, which is incredibly useful for those that you may use occasionally, but don’t want to dedicate a precious hotkey to: Alfred Maestro.

Finally, triggers aren’t just confined to mere hotkeys. Oh no. Pretty much any event you can think of can kick off a macro. If you want certain changes to happen when you connect to a particular WiFi, you can make that happen. Execute commands remotely by running Keyboard Maestro on a server? Why not. Run certain checks when a USB device is plugged in? Easy. You can even have Keyboard Maestro react to MIDI notes and values, which opens up a whole world of interesting hardware controllers aside from the keyboard… something I’ll be exploring in the next post.

In the meantime, go forth, and automate!

 

Advertisements

A Hyper Key Solution for Mac OSX Sierra

In the past I’ve mentioned how I have streamlined a lot of the everyday tasks I have to do through the use of various keyboard-centric apps such as Alfred and Keyboard Maestro. One of the linchpins of my setup is the use of something called the ‘Hyper Key’, which is essentially re-mapping the fairly useless Caps Lock to act as a super-function key, letting you trigger all sorts of shortcuts and different macros.

This particular configuration relied on two bits of software, called Karabiner and Seil. However, earlier today I was forced into upgrading from OSX El Capitan, to OSX Sierra, to fix an issue with some other apps that I was having. Of course, upon upgrade, I discovered that the Karabiner/Seil combination no longer functioned properly, and there was no real solution using the same tools. Sigh.

After a bit of digging, I discovered a way to re-enable the same functionality, albeit with a bit of jiggery pokery. Here’s how I did it:

  1. Install Hammerspoon. This is a piece of software that allows for automation, acting as an interface between a scripting engine called lua, and the OS itself.
  2. Install Karabiner Elements. This is a version of Karabiner that works with OSX Sierra. The latest DMG is available here.
  3. Under OSX Keyboard System Preferences pane, change the Caps Lock Action to ‘None’, to allow Karabiner to control it.

    Screen Shot 2016-10-28 at 21.12.04.png

  4. Set up Karabiner Elements to map the caps_lock to F18. You can also do this by adding in a config file to ~/.karabiner.d/configuration/karabiner.json, but it’s so easy to do manually that it seems overkill to go that route.

    screen-shot-2016-10-28-at-21-09-05
    How Karabiner Elements should look
  5. Now, load up a lua config file into Hammerspoon, by copying it to ~/.hammerspoon/init.lua – see below for examples.

The config file I am using is available over on GitHub here. It will re-enable the Hyper Key function for all a-z and 0-9 keys, as well as a couple of miscellaneous ones that I use, though it should be self explanatory on how to add new ones.

One thing to watch out for is that any Hotkeys set up in Alfred to launch applications with the Hyper Key don’t seem to work any longer, so for that, one way to get them to launch is to add a specific mapping in the init.lua configuration. Here’s what I’ve done to get 1Password to launch with CAPS+O:

-- Code to launch single apps that Alfred used to handle.
-- Hat-Tip: https://gist.github.com/ttscoff/cce98a711b5476166792d5e6f1ac5907

launch = function(appname)
 hs.application.launchOrFocus(appname)
 k.triggered = true
end

-- Keybinding for specific single apps.

singleapps = {
 {'o', '1Password 6'},
}

As you can see from the above, I obviously didn’t write the code to make all of this work. Credit for that goes to a combination of ttscoff and prenagha; I just tweaked it for my own simple use case and wrote this up in the hope that others might find it easy to follow.

Good luck!

Productivity Apps: Hazel

Time for another look at one of the tools I’ve found that has come to be invaluable in staying productive whilst working online. That is ‘Hazel’: a personal maid for your computer.

3533844787_1f22acccb9_o
CC Picture by ‘Robert Wade’

No, not that kind…

This kind:

Hazel-hero

Hazel is the most wonderful sort of productivity app, because you just set it up, and let it go. It carries on quietly in the background making sure that your Mac is kept clean and organised without you having to worry about anything. It’s so good in fact, that I had forgotten most of the tasks I had designated Hazel to look after, and so had to go back in and check for writing this article.

So what is it for?

I used to always get criticised by colleagues for having a desktop cluttered with all sorts of files – the tech equivalent of having a messy bedroom. The reality was that the desktop was the first place to pop up in the save dialogue, and it was handy to drop things there for quick access. I tried everything to get it under control, including monthly clear outs, and apps like desk drawer… eventually I just hid the icons on the desktop completely, so at least nobody else would know that they were there. The shame.

Hazel takes repetitive tasks like clearing up your desktop, and does it for you automatically. Ever since I hired in her help, my laptop has been more organised than ever before.

How does it work?

Setting Hazel up couldn’t be much simpler. There’s no intrusive menu bar icon (unless you want there to be), and the app runs as from a straightforward preferences pane. Here’s what mine looks like:

Screen Shot 2015-02-04 at 11.22.18

You choose the folder or location on your computer where you want Hazel’s actions to take effect on the left hand side, and then in the right hand side you set up the sort of things you want Hazel to do.

What sort of things can you do?

Let’s take the top example from the above image for a closer look: ‘Move Screenshots to Pics > Screenshots’.

Screen Shot 2015-02-04 at 11.24.29

I take a lot of screenshots throughout the day. Some of them are useless, and should be thrown away eventually, but others are quick notes, or things I want to hang on to for later reference. The default OSX behaviour is to place them on the desktop, which is convenient… at first. It can be a real pain to go through and move them all manually into a different folder. In the above image, you can see that I’ve set up different criteria. Basically if Hazel finds an image on the desktop that contains the words ‘Screen Shot’, it moves that file into a dedicated Screenshots folder under Pictures. That way I know where they all are, and periodically can go through them to see which ones I want to keep. The important thing is, they aren’t cluttering up my desktop, mixed in with all sorts of other guff.

Let’s say you don’t want to keep any of them indefinitely though. All you’re interested in is keeping the screenshots for the amount of time it takes to upload them online somewhere. No problem. Head on back to the main Hazel screen, create a folder grouping on the left for the Screenshots folder, and then create a new action to tell Hazel what to do with them:

Screen Shot 2015-02-04 at 11.28.59

There’s all sorts of things we can have Hazel do here. In this case, if the screenshots have been added more than a week ago, we can get Hazel to Move them to the trash, or maybe Sort them into a subfolder named ‘old’, or archive them… or add tags to remind us to go back and clear them out. There’s all sorts of possibilities.

What’s even cooler is the level of gradation you can get in the timescales:

Screen Shot 2015-02-04 at 11.31.47

You can get pretty specific about when, to make sure you target exactly the files you want.

What do YOU use it for?

Here’s an idea of the things that Hazel does for me:

  • Launches downloaded torrent files, and throws them away afterwards
  • Moves all downloaded, compressed files (zip/rars) into a single folder after 1 day has passed
  • Moves all downloaded RTF, DOC, DOCX, and TXT files into a ‘Misc Documents’ folder in ‘Documents’ after 1 day has passed
  • Moves all downloaded DMG files into a dedicated folder after one day has passed, and then deletes them from there once they get over a month old
  • Moves all downloaded app files into the ‘Applications’ folder (something I always forget!)
  • Moves all downloaded PDF files into a dedicated ‘Misc PDF’ folder under ‘Documents’ after 1 day has passed
  • Organises GIF, JPG, PNG, and PDF files into appropriate folders away from the Desktop
  • Deletes incomplete downloads that are aged from before this quarter

I also make use of the handy Trash settings:

Screen Shot 2015-02-04 at 11.46.48

The above is pretty self explanatory, but essentially it means that I hardly ever have to look at the Trash again.Oh, and the secure deletion option is pretty sweet. Not just restricted to Trash, Hazel can also keep an eye out for when I delete Apps, and offer to clean up the residual files that get left behind. If you later change your mind, and reinstate the application after deleting it, Hazel will offer to reinstall all of the associated preferences files for you!

Hazel keeps things ticking over, without me needing to worry about the little details in life.

But wait, there’s more…

Up until now I’ve really only scraped the tip of the iceberg with what Hazel can do. What I haven’t mentioned is that one of the actions that can be performed is to run an AppleScript or Automator workflow. This means that there are plenty of fairly complicated ways you can make use of Hazel if you sit down and take the time to work out the sort of tasks that would be helpful to your specific workflows. You are only really limited to your imagination (or the extent of AppleScript, anyway).

Here are some examples:

  • Set up a dedicated ‘resizing’ folder, where any images that get dropped in will be resized by Hazel and spat out to a subfolder.
  • Get Hazel to organise different files into different places based on coloured ‘flags’, like learning to ignore certain files from deletion if they are flagged ‘green’.
  • Organise PDFs saved from specific websites into dedicated folders. For example, if you download your payslips every month, Hazel can analyse the source and make sure they get put automatically into the right place.
  • Look out for e-mails from designated people, and send them to a particular Evernote project.

If you come up with any cool workflows, I want to hear from you.

How much and where!?

I know, I know. You want to employ Hazel right now. It’s understandable. You can get a free 14 day trial, or dive right in for a cost of $29 from Noodlesoft here.

Productivity Apps: PopClip

If you work online, there a whole load of tasks that can be a pain in the ass to have to do. Even if work itself is great, nobody likes having to do certain things… like copying and pasting different URLs into new browser tabs, or re-formatting garbled text.

One of the benefits of working at Automattic is being surrounded by friendly, smart geeks who have tried all sorts of different things to get the most out of their computers, and to tailor them to fit how they work. When you hit the sweet spot, your laptop really seems to sing; doing exactly what you want to straight away without having to footer about and get bogged down in the drudgery; it becomes almost like an extension of your fingers or brain. That sort of harmony can be a really great feeling, and let you enjoy working rather than it becoming a chore. I’ve written before about how great Alfred is for this.

One of the other tools that helps achieve this sort of inter-relationship for me was recommended by my friend and colleague Mark: PopClip for Mac.

original

PopClip is a small helper application for Mac and iOS that pops up a control panel when you select text. You can then quickly access a whole variety of different options, from the standard Bold/Italic formatting options, to looking up the text in the dictionary, Google translate, or whatever else you might fancy.

This is what my PopClip bar looks like:

Screen Shot 2015-01-26 at 15.33.31

Usefulness, and Integration with Alfred

At first, I wasn’t too convinced about this app. It seemed like one of those cool ideas that didn’t really play out properly in execution. The prospect of having the PopClip bar appear whenever I highlighted text seemed like it would become a real pain real quickly, and it did.

However, there were lots of cool features in there that I was sure would be useful at somepoint. I realised that rather than have the bar pop up every single time text was highlighted, Alfred could be used to control the behaviour through the use of Hotkeys.

As a result I created an Alfred workflow specifically for this purpose. You can download that here.

Once installed, you can toggle PopClip ‘On’ or ‘Off’ by using the keyword popclip from the Alfred launch bar. Alternatively, you can leave PopClip off, and trigger its menu when needed by the use of a hotkey – currently set to ⌘ + P. The latter is what I find myself using more often than not.

As soon as I realised that I could do this, PopClip seemed a lot more powerful than before.

Features

There are a whole bunch of things you can use PopClip for, so it’s just a matter of finding what is useful for your own particular workflow.

Here’s a glimpse at some of the extensions I have installed:

Screen Shot 2015-01-26 at 15.40.18

The ones I use the most are:

Instant Translate

This is a great extension. Highlight a sentence, call up PopClip and hit Instant Translate to get a translation into the ‘Destination Language’ that you set in the preferences. Saves the time and hassle of going to the Google translate page, instead bringing up the translation in a bubble:

Screen Shot 2015-01-26 at 15.46.24

That’s Greek, by the way.

Download Instant Translate here.

Google Translate

Of course, sometimes there’s just too much text to display in one little popup. The Google Translate extension grabs the selected text and passes it through to the full booner.

Shorten URL (bit.ly)

Pretty self explanatory. Grabs the selected URL and shortens it using the Bit.ly service. Download it here.

CopyURLs

This is one of my favourites. Often I need to deal with long e-mails that have various URLs in them. Going through these, copying and pasting the URLs out separately was always a real fiddly, and boring task. The CopyURLs extension did away with all of that in one quick swoop. Simply highlight any text, invoke the extension, and just the URLs from that text will be copied to the clipboard. Fantastic.

This beauty was authored by Brett, and is available to download as part of a bundle here. If you just want CopyURLs though, you can grab it here.

OpenURLs

Just like CopyURLs, but this time it takes the URLs in the selected text and opens each of them in a new browser tab. Pretty swish. Grab it here.

Abbreviation Lookup

Not sure what an abbreviation means? WTF TLDR? Highlight and invoke this extension to get taken straight to the meaning. I ended up writing my own extension for this purpose, as the existing one on the PopClip page wasn’t producting great results. Get it here.

Send to SimpleNote

I had been looking about for an extension that integrated with SimpleNote, but couldn’t find any. So, I wrote one. This will grab the select text and send it over to a new note in SimpleNote. Great for capturing quick thoughts you want to come back to later. Download it here.

Simplenote-demo
Image owned by Pilot Moon.

Custom Searches

Can’t find what you are looking for on the list of 100+ free extensions on the PopClip page? No sweat. You can easily set up your own. There’s a good tutorial here if you want to get down and dirty with AppleScript, but if you’re not ready for that yet, Brett again has created a fantastic wee tool to help you on your way. Simply plug in the site you want to search with the highlighted text, and this will spit out a PopClip ready extension for you to use.

Personally, I’ve created a whole bunch of quick extensions for things I need to search for at work regularly – like usernames, domain names, and e-mail addresses. Not dis-similar to Alfred’s Custom Searches function, using PopClip in this way makes the process even quicker for particular tasks, saving the need to copy the text, call up Alfred, paste it in then search. Instead, just highlight, call up PopClip, and hit the relevant search button. Easy!

Summary and Price

It can be hard at first to get into the habit of using PopClip, but there are real rewards to be reaped once you do. Certain tasks are made so much quicker than they would be otherwise, and it’s just a matter of finding out what will be of most use to you personally.

PopClip costs $4.99 from the App Store, but also has a free trial available on the Pilot Moon website. For all the hours it’s saved me copying URLs from lawyer’s emails, it’s been well worth it. Give it a bash and see what you think.