I have been using the following script in Keyboard Maestro to promote/demote paras in Word (for various reasons it works better than a straight custom-keyboard shortcut). Tell application 'Microsoft. Keyboard Maestro is your hot-key solution that allows you to perform a multitude of tasks simply by pressing a keystroke!It also incorporates the wildly popular MacOS Classic utility Program Switcher, which allows you to launch, switch, and quit applications with a simple keystroke.
Problem
tl;dr: It is easy to send messages to the wrong person using the Messages.app on macOS.
The other day I mistakenly sent a text message to my colleague that read “I love you.” I do love her as a friend but, I would never intentionally send her a text saying that. But, I did.
If you use Messages.app on macOS, you have probably sent messages to people mistakenly. Most use Messages to communicate with friends and colleagues. Cloud mate 1 5 8. This mix of potential audiences makes messages dangerous as sending messages to the wrong audience is easy. These mistakes occur because switching to Messages bring up the most recent conversation you were engaged in. Returning to a prior app state is the desired behavior in most applications as you typically want to return working from the spot at which you left. However, in Messages, this means that if I was last talking to Sam that is who I will be typing to upon reactivating the app. So, if I switch to Messages and begin typing a message intended for my wife, Sam will receive my message, not my wife. This is how you accidentally tell your colleague that you love her.
Solution
tl;dr: You can use Keyboard Maestro to send messages by typing a unique character string.
There are many solutions to this issue 1. The most obvious solution is attending to whom you are sending messages. However, I have been studying the human brain for about two decades and know that trusting one’s brain for this type of activity is not reliable. Computers are great at these tasks, so let them help you.
The solution that I have come up with uses a Keyboard Maestro Macro triggered by a typed string that takes user input (the message) and sends that input to an intended recipient (my wife and not my colleague). If you are not familiar with Keyboard Maestro 2, it is an macOS app that enables you to automate almost anything on your Mac. The Macro is simple. See the screenshots below for details.
The Macros trigger (what causes the action to happen) is a typed string 3. Once triggered, the Macro asks you to type the message you want to send. After, collecting this information, it then sends the message using Messages in the background to the intended recipient.
Setting up the trigger:
Type this string will trigger the macro
Executing Actions Based on the Trigger:
Asking the user for the message they would like to send
Sending the message using Keyboard Maestro’s “Send iMessage” action.
Other Small Benefits
There are other benefits of this approach that make it a great workflow.
Actions Happen in The Background
Keyboard Maestro actions use Apple Script that happen in the background. Therefore, you can think of a message, invoke the Macro, and send the message, all while keeping the focus on your current app. There is no need to locate the Messages app and the Messages app will not suddenly jump to the forefront of your screen. Once you get the trigger in muscle memory, sending a message is lightening quick and you still retain mental focus.
The Typed String Never Appears in Documents
Keyboard Maestro 4 automatically deletes the typed string trigger if it is typed in a place where text can be recorded. For example, if you invoke the macro in Microsoft Word, Keyboard Maestro will type backspaces equal to the trigger string leaving your document untouched. You can also trigger the shortcut without being in a text application. Typing the string when on your desktop works just as well.
Issues With The Solution
Only Text Input Allowed
The Keyboard Maestro solution only allows text input. Thus, you cannot send GIFs or Emoji’s with the Keyboard Maestro solution. Unfortunately, this means you cannot send cat memes or Dwight Schrute GIFs to your contacts.
Only Text Input Allowed
You cannot send “tap backs.” Message has a great feature that allows you to react to a message with various small emojis (e.g., heart, thumbs up or down, laughing). These tap backs are not supported by the Macro.
Only Messages (not SMS)?
Some people on the Keyboard Maestro forum (many years ago) reported that you can only use this action to send messages to people who use Messages (not SMS messaging). I am pretty insulated in the Apple Community and only need this Macro for sending messages to my wife, so I have not tested if this is still an issue.
Warning Message
Keyboard Maestro displays a warning noting that the action sometimes sends to the incorrect person. I have been testing the action for a while and have never had this happen. Also, because it is using Apple Script, this would appear to be an issue caused by Apple. I believe this is significantly less likely to happen when you use a phone number with action like I do in my examples above (rather than a token with the persons name). In my testing, the macro has worked every time but, the warning exists. There are other ways to create the Macro that might get around this issue 5.
One Line Input Box
The Keyboard Maestro macro contains only a one-line input box. Many lines of text can be entered but, you can only see one line of text at a time. For most messages, this is trivial. However, sending a large message may be cumbersome.
Other solutions
As always with automation, there are many ways to accomplish this task. This article mentions some ways to automate sending messages to a single person (and avoid sending messages to the wrong people). Other ideas ways to accomplish this task are below.
Drafts.app
The Drafts app can accomplish sending messages to people. However, you must type the message in drafts. Table plus linux. If Drafts is your primary text app, this may be okay but there will still be times that you are not in the app and want to send a message.
Apple Script
Apple Script can be used to automating message sending but, you will still need a way to activate the script.
macOS Launchers
Many macOS launchers like Launchbar and Alfred can also send messages. That said, in my view, they do so less eloquently (messages are not sent in the background).
Keyboard Maestro 8 2 – Hot Key Tasking Solutions
iOS Solution
Siri Shortcuts can automate message sending on iOS. You can create a Siri Shortcut that you can export to your home screen or to the Shortcuts widget that, when tapped, sends a message to a recipient(s).
Keyboard Maestro 8 2 – Hot Key Tasking Solution Answer
- In a perfect world, apple would allow users to set default people to which the messages app would default to upon activation. If this were the case, the messages app would aways default to speaking to my wife. This makes sense given that there is nothing that I would say to my colleagues that I would not say to my wife. The opposite is not true. ↩
- There is a great primer video on Keyboard Maestro hosted by David Sparks. The video is part of his Keyboard Maestro video field guide. But, to get a quick understanding of Keyboard Maestro and its power, just click “watch promo” on his site. The course is great. I own it. But, in this case, I am just suggesting you watch the promo video that he gives away for free. ↩
- In this case, the typed string I chose is my wife’s name with with a double first letter (e.g., ssally). This is because that is who I want to receive the message and I will never type her name with a double first letter. You can choose whichever trigger or keystroke you like but, be sure that it is memorable and not something you would otherwise type. Keyboard Maestro has many other triggers but, the typed string trigger seems most appropriate here. ↩
- I am running the latest version of KM (9.0.5) at the time of this writing. I cannot verify if this setting exists in earlier versions of the program. You can also turn this feature off in the options although I am not sure why you would want to. ↩
- You could script the action with Keyboard Maestro differently using its ability to find images on screen. One possibility is to create Keyboard Maestro Macro that activates Messages and selects the appropriate person for you. This would give you time to verify who you are sending the message to prior to sending (the current KM Macro sends in the background so you will only know it misfires after the message is sent). This method is less efficient and might sometimes fail when Keyboard Maestro cannot locate the image on screen. ↩