Automation With Shortcuts, Keyboard Maestro, Keysmith and Raycast
Creating A Shortcut And Running Into Problems
Part of the fun is to get the problem sorted out when you run into them. I really don’t mind if things don’t always go exactly do I think they should go. One of the things about being Good and Geeky is that you don’t give up and you push forward to find a solution.
Watch the tutorial - Mac Automation - Having a bad day, Possibly
So I just spent a couple of days making a video about converting a Keyboard Maestro macro into a shortcut. While I was actually my king of the shortcut I ran into a few problems here and there. I used to Regex in the macro to find patterns of text because I normal search wasn’t going to do the job. A pattern of text could be a specific character followed by three numbers, then another character and perhaps an equal sign to finish it off. So in this case it doesn’t matter what those three numbers are, it could be any of the numbers and the search will find every instance of that pattern. The Regex was different in one of the patterns I searched for in Keyboard Maestro I had to remove a forward slash to make it work in Shortcuts.

I set a keyboard key combination to start of the shortcut working, but I found I needed to use a couple of keyboard shortcuts first to select all and then copy the text. So I decided to do that in the KeySmith and then get it to run the shortcut. The first time I run the shortcut it worked fine. I was delighted because it around faster than the Keyboard Maestro macro. Then I started running into some problems, sometimes the shortcut woodwork and then sometimes it wouldn’t. I hadn’t made any changes so I was a little bit surprised by the unexpected behaviour. I spent a few hours trying to find out what was the problem and finally I worked out that I couldn’t trust KeySmith. So in the end I had to take Keysmith out of the equation. So I used Keyboard Maestro again to provide the trigger to start the shortcut. There is a possibility I could do all of this in Shortcuts, but at least when using Keyboard Maestro I can use a string as a trigger. When you’re working in a text file it’s probably the quickest and easiest way to get an automation working because I only have to type in two or three characters to get it started.
In Shortcuts I have found that the keyboard combination I set up to get the automation started it’s not reliable. When I have the application BBedit with the file open and I press the keyboard combination I’ve set, it doesn’t do anything. In Keyboard Maestro I can use an action which will run a shortcut by specifying the name of the shortcut.
So after some head scratching and some banging my head against a brick wall but I got the job done. I now have an automation which works using a Keyboard Maestro macro to get the shortcut from Shortcuts started. It works every time without fail. Usually I released by using the string trigger because my hands are on the keyboard anyway and it is the fastest way to get it started. I can also use Raycast if I can’t remember what the string is. Raycast has a Keyboard Maestro function which will give me a list of macros. I only have to type in a couple of letters to find the one I want.
So at the end of the day I’m happy with the final result of mixing Keyboard Maestro and Shortcuts to automate my work on the Mac. I’m still using Keysmith to do the first part of the job which gets the text out of Subler. I still don’t know why it was unreliable for the automation I was trying to make to clean up the text.
