Using BetterTouchTool and Keyboard Maestro to Make the Touch Bar Much More Useful

Love it or hate it, it seems that the Touch Bar is here to stay on the MacBook Pro. As such, it seems wise to me to make it more useful.

A little backstory first, though… earlier this year, David Sparks finally talked me into buying a Stream Deck to use at my desk. As with most things, he was right about how much I would come to love it.

The Stream Deck is incredibly flexible, but one of my most common use cases is to tap a single button on it to open a bunch of related Safari tabs when it comes time to prepare for a show.

For example, if I press the button with the MPU logo, it opens these pages:

  • MPU episode schedule
  • Folder of MPU Outlines
  • The MPU page in Relay’s ad-tracking system
  • The MPU page in the Relay FM CMS

I’m doing this via with Keyboard Maestro, another incredibly flexible tool. Here’s what that looks like, with my secret URLs redacted:

As you can see, on my Mac Pro, this is triggered by a specific button my Stream Deck, as pictured above.1

To re-use these macros on my MacBook Pro, I made a copy of them in Keyboard Maestro, which I have sync its data over Dropbox.

I then fired up BetterTouchTool, which among many other things, allows you to create custom UI elements on your notebook’s Touchbar, tying them to a wide range of actions. Turns out, you can even have BetterTouchTool become a trigger for Keyboard Maestro.

First, create a button in the Touch Bar section of BetterTouchTool, or a group that you can place buttons in, like I have:

The action you need to use is named “Execute Terminal Command (Async, non-blocking),” which makes the button fire off a script. Here’s the script itself:

osascript -e 'tell application "Keyboard Maestro Engine" to do script "PLACEHOLDER"'

Where I have that placeholder text, you’ll need to paste in the UUID of the Keyboard Maestro macro you want to execute. To get that, you will need to select “Copy as UUID” in Keyboard Maestro:

… and then paste it into BetterTouchTool.

(While in Keyboard Maestro, be sure to set the trigger for the macro to be a script.)

When this is all done, you can tap a button on the Touch Bar and fire any Keyboard Maestro macro you desire.

Happy automating!


  1. The non-show buttons control various lights in my office and control media playback on the computer. The Migration Assistant icon launches my normal set of apps after a reboot.