I hear lots of talk about Keyboard Maestro, yet I haven’t been convinced that I should bother springing for it. I have Hazel, and, though I set up a bunch of automations when I read @MacSparky’s Paperless book, I really don’t use it much. More and more I’m using my iPad for as much as possible. Any recommendations for something that would convince me that I need it? I suspect that Automators will do quite a lot of shows focusing on KM. @RosemaryOrchard, might a little ‘justification,’ in defence of KM be a to-do item in an upcoming episode?
I probably use Keyboard Maestro more than any other automation program. With the help of a Brett Terpstra style Hyper key I use it to do things like launch apps or bring them to the foreground, open a webpage that I have in Safari in Chrome, and quickly create new reminders in Due. It works great for kicking off automations when some condition on your Mac changes (connect to a particular wifi network, plug in a specific USB device, etc.). It’s also a great tool for automating software that doesn’t have great built-in automation features. You can record a series of mouse clicks and key presses in an app and play them back on demand.
If I were to define a “Mac automation hierarchy” it would look something like:
- Text Expander
- Keyboard Maestro
- Stuff involving actual code (shell scripts, scripting languages, etc.)
So if you’ve got Hazel and want to take the next step, Keyboard Maestro is it.
If you’re not going to be using a Mac then it’s not the tool for you, if you have a Mac running in the background then it can do things automatically for you (mine creates custom OmniFocus calendars and updates them regularly for me) - but it depends on your needs. Perhaps start a list of things that we mention and you find that can be accomplished with it and then once you have 5 evaluate it again?
That’s a great suggestion, Rose! Finding a “tipping point” for go for it. Nice.
P.s. Pray tell, what is an “OmniFocus Calendar”? I know it’s off topic, but you’ve piqued my interest.
It’s useful from time to time to see my OmniFocus tasks in my calendar to get a better big picture view of what’s going on - the Forecast view is great for short term, but this is handy for long term. I have a script which grabs all the incomplete tasks from OF and puts them in the calendar - it also means they show up on the Siri face on the Apple Watch, though the latter will likely be accomplished with the Shortcuts hooks in iOS 12.
I use KM for:
- automating tasks that require more than one keystroke, and that I do frequently;
- automating tasks that are more complex than simple AppleScripts, Automator workflows, and shell scripts, combined with the OS’s keystroke mapping, allows, to create long, complex workflows that combine the capabilities of other automation tools;
- accessing hooks that are difficult to access using other automation tools; and
- generally, fixing bothersome behavior and enhancing my control over my my Mac and apps.
Here are some examples of how I use KM every day.
Tasks that require more than one keystroke and that I do frequently;
- Open a Finder window from any app with a single keystroke
- Open specific file system locations in new Finder windows
- Apply text styles in Bean with a single keystroke
- Type my return address, email, phone number, and date in word processors when I type “takealetter”
- Prepare letters to various people (my return address etc., the date, the addressee’s address, and salutation)
- Remap shortcut keystrokes in apps for convenience and consistency (e.g., I have mapped Cmd-K to “Make link” in several apps that natively used different shortcuts)
- Present a list of options when I type Cmd-N in Devon Think to create a new object (i.e., New RTF document, New text document, new Group, etc.)
- Insert various snippets of text with a single keystroke or mnemonic (e.g., “-1d” for yesterday’s date)
- Insert various dates (e.g., today’s, yesterday’s, 2 days ago, etc.) in various formats (e.g., YYYY-MM-DD, “Thursday, July 12, 2018”, etc.)
- When saving a Nisus Writer Pro document or PDF from NWP, pre-fill the document name in the Save dialog with the date (or yesterday’s date, etc.) followed by the first line in the document that will serve as its title
- Log in to various (non-confidential) websites
- Present a list of email accounts to use to create a new email when I press Cmd-N in Apple Mail (which alleviates the problem that Mail never seems to select the account that I want)
Many of these tasks can be accomplished with AppleScripts and Automator workflows that are bound to keystrokes in System Preferences-Keyboard-Shortcuts, or by the native text substitution capability. But, my other use cases is where KM starts to get interesting.
Automating tasks that are more complex than simple AppleScripts, Automator workflows, and shell scripts, combined with the OS’s keystroke mapping, allows, to create long, complex workflows that combine the capabilities of other automation tools:
- Copy selected content from a page loaded in a web browser, and the URL, open a new Nisus Writer Pro document, paste the content and URL, call a NWP macro that formats the text and paragraph styles, searches for and deletes garbage text (this does 90% of the work needed to prepare a nice-looking document from web content that I can save as RTF or PDF; this long and complex macro also does similar steps with content selected in an email or in a Devon Think document or web page; the macro tests to see which app has focus and acts accordingly)
Accessing hooks that are difficult to access using other automation tools:
- Perform tasks when a computer wakes from sleep – I use this hook to run an AppleScript that closes and reopens Apple Mail (because it always stalls out before the computer establishes a network connection, which is hugely annoying), ejects my iPod which is charging (so that I don’t have to do it manually, which is a convenience), and calls a shell script to unload and reload a custom launch agent (to prevent multiple alarms that have stacked up while the computer has been sleeping from going off, another convenience)
Some other hooks that KM exposes are:
- Perform actions when a specific external USB drive is connected or specific volume is mounted
- Perform actions when a specific wireless network is connected to
- Perform actions when a specific application is launched
- Perform actions when a specific window appears
- Perform actions periodically or at specific times
- There’s even a new “gesture” trigger that can respond to gestures traced on a trackpad (which I haven’t yet explored)
Oh, and parse text files, perform regex, call macros from within macros, show the clipboard history, the list of features goes on and on.
The developer is responsive and there is a lively forum at https://forum.keyboardmaestro.com/
The main product page is at https://www.keyboardmaestro.com/main/
(No affiliation, just a very happy user who has been using KM every day for years.)
@misterharrycrumm, thank you. What an exhaustive list of the benefits of KM. I am certain that many people will benefit from this post for years to come! Delightful, and impressive. I am in awe.
@EricArmstrong, I’m glad you found my post useful. KM is to me indispensable. It presents so many options and capabilities that it can be intimidating at first, but if one starts with simple things like text substitutions, and gradually moves on to more complex macros that (for example) interact with and control applications, then on to adding AppleScripts for custom actions, then on to the deeper hooks, one will quickly amass a rich portfolio of automation gems that solve problems and fill in the workflow and functionality gaps that one faces every day. And do check out the KM forums. You’ll be really impressed with what others are doing and the wide range of problems and solutions offered up.
I would love to hear more about this. Is your script available publicly somewhere?
Is your script available publicly somewhere?
@Drewster, I’m sorry, but I do not maintain a website and do not participate in social media or file sharing sites due to security and privacy concerns.
He was replying to @RosemaryOrchard, so I assume his request was actually directed towards her
Sorry. I am a bit confused by the design of this forum…
If you check in the top right of a post then if it has a reply arrow and a person the person is replying to a specific person - and by tapping/clicking that you can see which post in particular!
@Drewster - I’m in the midst of writing up a blog post on that! Keep an eye out for it (and I’ll try to remember to post it here and tag you in it).
I don’t use KM that much but when I do it is great. One recent use was that I had to approve 200+ items in a web page that meant I had to: 1) click the approve icon 2) click the confirmation popup 3) refresh the webpage.
So I just created a temporary KM shortcut using the “move and click” and “pause and wait.” So basically I did this once and it still took about 20 minutes to approve everything but I just did it and let my computer run it.
Personally, I find these temporary actions mostly what I use it for.
Some regular actions that I have:
- Each month I have to send in recurring billing receipts so I have a shortcut that opens up 11 different safari pages that go straight to the billing page on each website. Saves time so I don’t have to dig down into each website’s billing page
- Use the simulate scroll real for some recurring actions that I have to do. Keeps my hands on the keyboard
- Insert row in Excel for Mac
- Quit all apps that are open
Just a sample to maybe spark some ideas
Yes I was, but Discourse threading can be a little opaque!
My favorite bit of magic on Keyboard Maestro is logging into my company’s VPN.
The macro is triggered by the SSID of the WiFi network, and then KM manages to start the VPN client, Find the button to initiate the connection, input my user name and password (predefined), and then find the “connect” button and press it.
The look on people’s faces in the office every time they see this macro in action is worth the cost of the KM license 10x over.
You can get very fancy with uses, I tend to focus on more practical uses such as default printer switching, along with some app specific controls. It’s definitely one of my magic trio of go to apps on my Mac.
I also have a KM macro that triggers on an SSID name. In my company, we have two separate wi-fi networks, internal and guest. Usually I am on internal and use kerberos for authentication. Occasionally, I hop onto the guest wi-fi to test things from the outside. When I do that, my kerberos tickets interfere with the “coffe-shop” authentication page that the guest network uses.
My KM macro triggers when I connect to the guest network and deletes my kerberos tickets so that I can successfully authenticate to the guest network. It is not hard to delete the kerberos tickets manually, but I always forget about doing it, so this macro saves me a few minutes every time I need to use the guest wi-fi.
I have some mail templates set up in KM as well. They prompt for the values that change each time, then fill out the To:, CC:, and subject fields; write the body of the email, and add a correctly formatted hyperlink to where I just uploaded the relevant files. Then I just review the message, check the link, and click send.
I’m toying with buying KM. I’ve not done any research bar listening to MPU. I hope there will be an upcoming episode of Automators about this app.
In the code I support “local host” web URLs have complex query strings.
A couple of days ago it took me all of ten minutes to write a Keyboard Maestro macro to parse the current page’s query string, prompt the user with all the individual component values such that I could change them, and then paste in the new URL and hit enter.
For example, I’m looking at data for SYSA and I want to quickly switch to SYSB. I just hot-key this and overtype “SYSA” with “SYSB”in the dialog put up by KM and hit enter. The macro changes the system portion of the query string and hits enter. And hey presto I’ve switched systems.
This macro takes a cumbersome and error prone fiddle with a URL and makes it very swift, reliable and simple.
And I can build on this.
This is the sort of thing I automate with KM to make my life easier.
I’m a cheapskate and use the incredibly priced ($4.99) aText, that is very capable, rather than the very feature rich and expensive TextExpander. For complex text expansion that aText can’t handle, I write a Keyboard Maestro macro . That more than offsets the cost of Keyboard Maestro, but I also use it to set up my Mac for various tasks, for scheduling & performing backups, the list keeps growing… Money and time learning the capabilities, well spent.