Texting Kid on 3 Messaging Platforms at the Same Time (Sort Of)

This is my first macro. It is messy and imperfect. Suggestions are welcome.

The idea is to use my iPhone to text my son on his 3 messaging platforms -- iMessage, Discord and Snapchat -- with the same message, at the same time.

I tried to create an iPhone macro in Shortcuts, but due to limitations in scripting for Discord and Snapchat (or my limitations as a novice), that was a no go.

So, I used a combo of (i) Keyboard Maestro, (ii) iPhone Shortcuts, and (iii) Apple Continuity, to create a macro that mostly works.

These messy processes are trying to address (a) iMessages, which has robust support for scripting on the iPhone and Mac, (b) Discord, which has clients on iPhone and Mac but poor scripting support on both, and (c) Snapchat, which only has an iPhone client that has poor scripting support.

I encourage forum participants to share how this could be more elegant because this is an ugly, incomplete solution.

  1. First, I wake my Mac because I realized that passing data to the Mac's system clipboard from the iPhone does not always work if the Mac screen is off. To do this, I created an iPhone Shortcut that triggers a remote Keyboard Maestro macro, which in turn

  1. via Keyboard Maestro, wakes the Mac, and then moves the mouse in case it is resting in my lower-right screen corner that puts the Mac to sleep.

  1. I use the iPhone Shortcuts app to Ask for [text] with [Prompt]. My answer, 99% of the time, is "Time for Dinner!"

  2. Next step, "Copy [Provided Input] to Clipboard.

Note: This is the point at which Apple's Continuity becomes important. This macro assumes that my iPhone and Mac are communicating on the same Wifi network. In other words, the clipboard on my iPhone is shared with the System clipboard on my Mac.

  1. Next step, Wait 1 second. I added this because sometimes the macro moved too quickly.

  2. Time to push the processes back to the Mac with a remote Keyboard Maestro trigger using a URL.

This is when the texting action takes place.

  1. Keyboard Maestro elegantly handles using iMessage to text the contents of the System Clipboard.

  2. Discord is not as simple. Discord has a client for the Mac, so I used the "Move and Click" commands in Keyboard Maestro to click on the location for "Home", then my son's "Direct Message" name, and then the text entry bar to text my son. Then, Keyboard Maestro again pastes/texts the contents of the System Clipboard.

  1. Since Keyboard Maestro is done with its tasks, the iPhone returns to the Shortcuts macro and completes the last step, which is loading Snapchat. I could not figure out how to automate, so I manually click on texting and paste the clipboard, which continues to be the same message and hit return.

Thoughts? Recommendations? No need to pull punches if this is awful and you would do it differently.

2 Likes

Hi @Chris3 - nice to see you on the KM forum!

Thanks for the write-up: you’ve clearly put in a lot of work and I’m sure there are a lot of KM users who will find your ideas and methods very interesting.

I have one suggestion to make and it is in connection with the use of the clipboard to pass the text of your message. That in itself is OK but what I find introduces some uncertainty is the 1-second delay to allow continuity to kick in. I mean sometimes it could be .2 of a second and sometimes 1.3 seconds before the clipboard gets shared - it’s a bit unpredictable. So to make your system more reliable my suggestion would be to use the TriggerValue feature of the KM remote trigger to pass the text of the message. That way you do not need to use any delay and, on the KM end, you would use the %TriggerValue% token in your macros instead of the clipboard to retrieve the text of your message.

The KM wiki page about remote triggers goes into detail about how to use the TriggerValue parameter in the URL. See trigger:Remote [Keyboard Maestro Wiki].

I hope you get the drift of what I’m saying but if you have other questions - fire away!

Cheers!

1 Like