Examining the "Send iMessage" and "Send SMS" actions

I hope I’m not stepping on anyone’s toes by moving this from another topic discussion.
I have been working with KM’s ability to send a text message via the Messages app.
It seems to work fine when sending to an iPhone, but can be rather fickle and kludgy when trying to send a message to The Dark Side. Sometimes it works, and sometimes it doesn’t. There seems no rhyme or reason for it’s failings. Many times it attempts to send to an non iPhone as if it were and iPhone (blue text balloons vs. green text balloons).
I suspect this is a problem with the Messages application, and not KM.
I’m wondering if anyone on this forum has found any solutions to, or workarounds for, these shortcomings, Or has anyone successfully used KM to communicate text messages through any other Mac applications?

And, Peter, could you clarify exactly what is the difference between the “Send iMessage” and “Send SMS” actions? They both look identical, save for their titles.


There was some recent discussion here:

iMessages are Apple's proprietary messaging format, and only work within the Apple ecosystem (ie, Mac/iOS).

SMS is a standard telephone messaging service, which is generally text only and limited to a small number of characters (140?), although there are enhancements to send multiple packets and images (MMS).

In either case, Keyboard Maestro operates by accessing the Messages app via AppleScript to send the messages, and so you can simply use the Messages app initially to see what you can send and to who.

Yes, I have not had Messages be particularly reliable even in normal use - for example, I have had it send to the wrong person, suddenly change conversation after explicitly selecting a person, and currently it is showing two "New message" threads at the top of my Messages window which is weird. Naturally, Keyboard Maestro cannot do anything about these weird behaviours I'm afraid.

May I ask for clarification, do you mean Messages is doing bad things when you access it through the KM action, or do you mean it has problems even when you are accessing it through its macOS app?

No, when I use the Messages application normally.

Thanks for the clarification. Then I have to be careful to handle exceptions when I manipulate the Messages app as a window from KM.

The biggest complaint I have with sending a message through Messages on the Mac is that many times, although I am sending to an Android phone, it tries sending it as an iMessage (blue text balloon), not as an SMS (green text balloon). Usually have to hit the “i” that is to the lower right of the undelivered message, then tell it to send again, before it realizes that it is not sending to an iPhone, and send sit in a green balloon.
I can send iMessages to Apple devices all day long, with no problem.
Unfortunately my customer base, whom I am sending these messages to, can have a phone running on any platform. There is no way of segregating Apple from the others, so I need one KM that does double duty in sending to iOS and Android.
. . . So Peter, is there any real difference between the “Send iMessage” and “Send SMS” actions? If so, could you explain what these differences are, please? To the untrained eye, they appear identical.


The underlying AppleScript is slightly different for the two methods. You can look at the Messages dictionary using the Script Editor.

So, if I am interpreting this correctly:

If you utilize the “Send iMessage” action, it will format and attempt to send the message to an Apple device, whereas the “Send SMS” action formats specifically as an SMS?

I ask because utilizing either action to send a message usually works fine when the recipient is an Apple product, but if your message’s receiver is an Android phone, it can balk or plain out refuse to send the message. This is fickle, to say the least. One never seems to know whether it is going to work or not, beforehand. Many times it sends the message as an iMessage (blue text balloon), instead of in a green text balloon (SMS). This can happen EVEN if you already have established a dialog of texts back and forth with the Android user, and all of your prior messages have been in green balloons. Presto, the next message tries sending to the same recipient, with same telephone number in a blue balloon.

Whereas, if you use the “Send SMS” action, it seems to anticipate that the message is intended for a non-iPhone, and utilizes the green text balloons. Unless, of course the telephone number you are sending to is an iPhone, then it responds with the blue text balloon.

All very confusing. I guess what I’m trying to establish is if there are any “ground rules” in this game of cross-platform messaging that would help clear up this confusion.

BTW, I’m more flummoxed now than I was before I started writing this!