Matt Gemmell

Raw Materials book cover image

My book Raw Materials is out now!

A collection of personal essays, with exclusive content and author's notes.

» Find out more

Keyboard Maestro macros

3 min read

I’ve previously written about the Mac keyboard shortcuts I use most often, and also talked about being productive on a small screen. Productivity (and avoiding the mouse or trackpad) is very important to me, and to that end I use a macro utility on my Macs called Keyboard Maestro.

Keyboard Maestro can do just about anything, including complex, multi-step automations, scripting, interface control, periodic tasks and hundreds of other things. If you can do it yourself, you can probably get Keyboard Maestro to do it for you.

In this brief article, I’d like to share some of the macros I use most often.

I use these macros on both of my primary Macs (Keyboard Maestro can sync its settings and macros via Dropbox, and a number of other file-synchronisation utilities). You can also enable or disable groups of macros on a per-machine basis, so I have sets of “iMac only” and “Air only” macros too.

I have many more macros than those mentioned here, but these are the most generally-useful ones I’ve created. You can download each individual set of macros below. You can also host these macros elsewhere, if you wish, as long as you provide attribution and link to this page.

Most of these macros have keyboard-shortcuts as triggers, but you can easily change that to whatever sort of trigger you like: a floating palette, a menu item in Keyboard Maestro’s status-bar menu, when an app is launched, when you log in or connect a specific device, or many other possibilities.

Safari

These four macros act on the URL of the frontmost tab/window in Safari. They look for the last numeric parameter in the URL, and either increase it or decrease it, then reload the page. There are macros to increase or decrease by either 1 or 10. They have keyboard shortcuts set up by default.

These are very handy for viewing online galleries, multi-page articles, indexes and so forth.

Download Safari macros

Mail

This macro lets you type hisender (“hi sender”) when replying to an email, and it will be expanded into a basic greeting, using the sender’s first name.

Hi [Firstname],

Thanks for your message.

The insertion point will be placed immediately after the last inserted sentence. You can tweak it to suit your needs.

Download Mail macros

Finder

This macro is actually by Andrew Burgess, with minor tweaks by me. It works on the selected file in the Finder, moving it to your Dropbox’s public folder and putting a sharing link on your clipboard.

You’ll have to tweak an URL in the script to reflect your own unique Dropbox public ID, which you can find via the Dropbox web interface. You’ll also need to tweak the script to point to your Dropbox folder, if it’s not in the default location.

Download Finder macros

Global

There are a few different macros here:

  • Centre mouse on the main screen. Does just what it says, and briefly highlights the cursor.

  • Dismiss Notification. This one moves the mouse to the ‘Close’ button of the topmost (most recent) on-screen Notification Center notification, and clicks the button. Technically, it double-clicks the button, which ensures the notification is dismissed (single-clicking was unreliable).

  • Front window to image on Desktop. This takes a screenshot of the frontmost window, asks you for the filename, and saves it as a PNG on your Desktop.

  • Right-click in frontmost window. I don’t like using the mouse, but some commands only exist in contextual menus. This macro pops up a contextual menu in the middle of the frontmost window. You could tweak it to do so under the cursor instead, if you like.

  • Type clipboard. A trivial macro that types out the contents of the clipboard, one character at a time. Useful for apps or sites that inexplicably and stupidly disable the Paste function in password fields and such.

Download Global macros

That’s all for now, but I’ll be sharing more macros in future.

I highly recommend Keyboard Maestro to you; it’s been a godsend here. The more time I spend with my hands on the keyboard instead of the mouse, the more productive I am.


You can follow me on Twitter to keep up to date with articles like this.

My writing is supported by readers like you. Any contribution helps enormously. If you’re a business interested in reaching my readers, I also offer sponsorship opportunities.