Keyboard Maestro Logo

“It’s Showtime!” – Brought to You by Keyboard Maestro

Ever since Mike Price started working on how to automate the creation of chapter marks into the podcast using Keyboard Maestro, I’ve been taking baby steps to do things with this amazing macro tool myself. I am definitely still on the bunny slope with the tool, but I feel like I’m starting to get how it can help me. I’d like to tell you about a few of the automations I’ve been working on with this fully-accessible macro tool.

Recently Jay Miller in our Slack posted a very fun invitation to the community. He wrote:

Wrote a couple blog posts around working with text in Keyboard Maestro – This seems like the kinda folks that may have Keyboard Maestro needs and I have a couple days off so if you have any requests on how to do things just DM me. (Background, I’m a Mac Automator and Developer)

I immediately wrote back, “You’ve unleashed a monster. I’ll get my list ready.” And I did. The first thing I wanted help with was a tiny, minor annoyance but those paper cuts get to you if they go on too long.

Preview – Show Markup Toolbar

Show Markup Toolbar in Preview as described in the article
Show Markup Toolbar in Preview Macro

Just last week I walked you through all of the cool markup tools in Preview. I use these all day long. The paper cut problem is that by default, Preview opens up with the Markup Toolbar closed. I asked Jay if he could help me make a macro to have it open automatically whenever a Preview was active. He and I went back and forth a bunch in an open Slack conversation but after a while, we figured we were just annoying everyone so we kept at it one on one for a while. He gave me a big boost (pointing out that there’s a keyboard shortcut of command-shift-A to open the Markup Toolbar 🤦🏼‍♀️) and doing a lot of the early heavy lifting.

The basis of his idea was to have Keyboard Maestro look to see the status of the button for showing the Markup Toolbar. If it was greyed out, that meant the toolbar wasn’t visible, so it would trigger the keyboard shortcut. After we got that working, I discovered another problem. If the window was too narrow, the Show Markup Toolbar icon wasn’t visible at all so the macro wouldn’t trigger. All by my lonesome, I figured out how to get Keyboard Maestro to measure the width of the window and resize it to the minimum width for the icon to show. I was very pleased with my little self.

My blind side as a developer though is that I don’t immediately think of all the ways something can go wrong, which is an essential part of making sure there are not unintended consequences. After I enabled my snazzy new macro, I started having all sorts of bizarre behaviors on my Mac. The weirdest one was that I couldn’t rename anything on my server when using the FTP client Transmit. As soon as I hit Enter on a file name, which should have turned it blue so I could type over the name, it would deselect the item and the window would kind of giggle.

The good news is that I’d just enabled the macro so I quickly guessed it might be the culprit. Disabling my macro allowed Transmit to operate normally. I figured out how to get my Keyboard Maestro macro to only work when Preview is in front and now my precious Markup Toolbar is always visible.

If you’ve done any work at all in Keyboard Maestro, you know that this is a tiny little macro that’s not very powerful, but I still felt like I made fire when I built it, with Jay as my fire starter!

Live Show

That spark is what leads me to my slightly more complex and super useful pair of macros that I wrote all by myself. A long time ago I wrote an Automator script to launch all of my applications I need to run the live show. I wrote a second one that closes the applications for the live show. The script works, but there are things it doesn’t do or doesn’t do well. It’s really scope creep from the original problem to be solved, but once you get something automated, you start thinking about refinements and improvements as you use the automation.

I’m also concerned that at any moment Apple is going to abandon Automator and instead give us Shortcuts on the Mac. In the meantime, Keyboard Maestro is independent of Apple’s decisions in this space so I’m embracing it.

Let’s review the full set of requirements I have for my live show macros as they stand today:

  • First quit all backup and syncing applications to minimize network traffic
    • Dropbox, Google Drive, and Carbon Copy Cloner all allow themselves to be disabled
    • Sadly Backblaze, which I keep running constantly, does not allow itself to be disabled temporarily. The only option is to change the syncing to “when I push the button”, then reboot the Mac. To change it back, another reboot is required
  • Turn off WiFi
    • mimoLive, the application Steve and I use to broadcast the different video feeds of ourselves and my recording app Hindenburg, does not operate well with WiFi turned on.
  • Launch the 6 applications I use and open a Finder window so I can easily get to listener recordings
  • Resize all of the windows and move them to the locations I have defined

The Live Show’s Over macro needs to do the opposite and a few more things

  • Enable all my backup and sync services
  • Turn WiFi back on
  • Quit some of the live show-required apps
    • I don’t kill them all, because while I want to stop broadcasting, I often still have work left to do in some apps, like Hindenburg and MarsEdit
  • Launch the Auphonic website so it’s ready for me to upload the podcast for processing
  • Launch Feeder so it’s ready for me to update the podcast feed to deliver the show to you
Live Show Macro
Live Show Macro
Live Show's Over Macro
Live Show’s Over Macro

I was really surprised at how easy it was to replicate these actions in Keyboard Maestro and to make a much more reliable process. For some reason with my Automator script, toggling WiFi was a problem – I could get it to turn off, but never to turn back on. With Keyboard Maestro I used an AppleScript I found on GitHub (and credited of course) not to toggle it, but to specifically turn it off, and then later to turn it on. This one may have worked in Automator but I’ve moved on now.

Mike Price taught me a valuable thing in Keyboard Maestro that I don’t think I would have thought to go looking for on my own. You can group actions together, and they get an enclosing box. You can also change the color of the background of the group and give it a name. This makes for very well-organized code where at a glance you can jump in and fix something. For example, I have a group entitled “Launch Syncing and Backup Apps” with a bright lime green background.

Another touch I like to add to my automations is a completion sound. I know when I hear the sound “Hero”, my Live Show’s Over macro has completed successfully.

And just because it’s fun, I like to add an icon for my macro. For the Live Show macro, I made it a flame, and for the Live Show’s over, it’s a fire extinguisher. Seems logical, right?

I created both of these macros with a hotkey trigger, which works well, but then I realized that I need to run the Live Show macro every single week at about the same time. I figured out how to have it trigger at a time of day, but kept my hotkey trigger so I can enable it at any time as well.

None of these three macros I’ve worked on this week are groundbreakingly clever, but since Keyboard Maestro users are a happy sharing lot, I’ve put links to download my macros so you can see how they look in Keyboard Maestro yourself.

Keyboard Maestro lets you import other people’s macros with the File → Import Macros Safely… option. This means when they’re imported, they are automatically disabled. You can safely peruse what they do, learn from them, modify them, and only when you’re confident they aren’t going to damage anything, enable them.

Next Up

My next target for automation is to fix what Apple most certainly thinks is a design choice but I would call a bug in Big Sur. Every Finder window and every Save As and Open window starts with the left sidebar too narrow to show the text of the items I have in my sidebar.

Every week I create a folder for the current week’s NosillaCast. The name structure is NC_YYYY_MM_DD. I put the most current week’s folder in the left sidebar of the Finder, and I usually keep at least the previous week’s folder in the sidebar as well. It’s not uncommon for me to have content that I push out a week, so I need quick access to the folder from the previous week.

With this delightful change to the sidebar in Big Sur, I see 2-3 folders that say “NC_2021_…” which is not at all helpful!

I’ve gotten a start at an automation in Keyboard Maestro that already successfully widens the left sidebar to 220 pixels, but I’m still working on how to get this change to apply to both Open and Save As dialog boxes. I’m having fun and I’m sure I’ll conquer it between the great documentation on the Keyboard Maestro wiki, the community who supports it in their forums, and of course Jay and Mike!

Should you try Keyboard Maestro?

You might be wondering if you should try Keyboard Maestro. I asked Bart if he had tried it yet. His answer was very interesting. He said that he’s very tempted to dive in, and yet he’s equally hesitant to try it. His reason for hesitation is that he’s worried he’ll enjoy it too much, and spend a week automating a task that takes only 2 minutes to complete. I think that’s a fully legitimate concern, and I guess everyone has to learn to manage their own impulses.

I’m sure in a few cases I’m spending more time than I’m saving (like spending 2 hours writing a macro that essentially hits the keyboard shortcut command-shift-A in Preview), but I’m definitely on the steep slope of learning how to automate with Keyboard Maestro. Perhaps as I get better at it I’ll spend even more time, or perhaps I’ll become more efficient with my time.

What I can say categorically is that my two Live Show macros do more than save me time. They create a predictable environment for the show. If I forget to turn off WiFi, for example, my video will be choppy and broken up until I realize I forgot that step. By default, my Logitech c920 doesn’t have a way to store and launch with a good exposure and color profile. To overcome this limitation on the Mac, I use the menu bar app Webcam Settings. If I forget to launch it, again my video looks bad, but with my automation, I never forget.

When you’re thinking about learning Keyboard Maestro, think about things you do repeatedly that are not just time-wasting and annoying, but also which are error-prone. Then let yourself get sucked into the madness!

I’m sure I’ll talk about Keyboard Maestro again as I continue on my coding and automation journey. For $36, it’s already given me some fun and opened up my mind to how I can automate my Mac to do things for me.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top