A reader, Pierre Boucher, asked if I had tried using AppleScript to send SMS. I hadn’t but a quick web search revealed a fairly straightforward approach, so of course I had to see if I could make it work.
Download Demo File


My two web sources were:
http://www.cubemg.com/how-to-send-a-text-message-with-applescript/
tell application "Messages"
set iMessageid to get id of first service
set theNumber to buddy "+1yournumber" of service id myid
--enter the number that you want to send your message to here
send "CubeMG just made my life 10x easier!" to theNumber
end tell
This didn’t work right away, because there was a small bug in the script, it should have read:
tell application "Messages"
set iMessageid to get id of first service
set theNumber to buddy "+1yournumber" of service id iMessageid
--enter the number that you want to send your message to here
send "CubeMG just made my life 10x easier!" to theNumber
end tell
I saw more discussion with regards to the issue of naming the ’service’,
Equipped with someone else’s hard work of figuring this out, I was able to translate this into FileMaker with the script:

And the juicy bit was the Set Variable $TheAppleScript.

So now, I have four blog posts about sending SMS from FileMaker.
Basic SMS – Dirt simple approach: use the sms: tag on a phone number. The limitation seems to be that you still have to flip over to iMessage and click ‘Send’/ This might work with Windows as well, though not tested.
Shortcuts approach – More complicated approach that will work on both Mac and iOS devices. It is more finicky because you have to set up the Shortcut as well. More moving parts.
AppleScript approach – Mac only, includes Send.
All three of these approaches are included in the current demo file, but if you want more detail on any of them, just click through the the appropriate blog entry.
There are other ways of doing this, including the use of Twillo. DB Services have documented that approach. Employing a third-party service and an API brings the benefit of two-way communications. It also usually has some cost associated per message sent.
See also
Part 1: Sending SMS Messages from FileMaker
Part 2: Sending SMS Messages from FileMaker using Apple Shortcuts
Dialing for Dollars – Getting FileMaker to Call or Text to an iPhone, Skype, Facetime or Zoom
Bonus AppleScript Debugging Tip
When troubleshooting this AppleScript from FileMaker, I used the Calculate AppleScript option.

I built up the AppleScript in a FileMaker Variable and of course it didn’t work properly the first time I ran it. To troubleshoot, I brought the calculated AppleScript to the surface by requesting a dialog box using the Show Custom Dialog step. It seems to me that I used to be able to copy and paste text from these dialog boxes, but that no longer works, so instead, I chose to paste a screenshot into Preview app and copy the text from there.





Hi, wonderful job, with compliments. I think the best Internet Message System in the world is Whatsapp. Is there a system or Api method to interface with it too?
Best Regards
From what I can see, WhatsApp on the Macintosh doesn’t seem to have an AppleScript dictionary, so anything you could do would be clunky using that route, although someone suggested starting here:
https://apple.stackexchange.com/questions/322453/sending-whatsapp-message-through-automator
on run {input, paremeters}
tell application “Whatsapp”
activate
end tell
tell application “System Events”
keystroke “Your message here”
end tell
end run
Mike Beargie noted on the Claris Community forum four years ago:
https://community.claris.com/en/s/question/0D50H00006dsl0uSAA/integration-of-filemaker-and-whatsappwechat
“Whatsapp doesn’t really have an official API. They have a URI Protocol via a formatted URL
https://wa.me https://community.filemaker.com/external-link.jspa?url=https%3A%2F%2Fwa.me
See: WhatsApp FAQ – Using Click to Chat https://faq.whatsapp.com/en/26000030/?category=5245251
Using this in FileMaker is simple, just use the Open URL script step to open the click to chat URL.”
I see WhatsApp now has an official API, so probably it can be done through a service like Twilio. And in fact, the smart guys at Databuzz in Australia have a blog post on this very topic. https://www.databuzz.com.au/sending-messages-from-filemaker-to-whatsapp-users-with-twilio/
I checked and Claris Connect doesn’t seem to have an integration for WhatsApp at this point.
You could probably build your own two way link directly to WhatsApp through their API, but that is likely to be a bigger project. The documentation starts here: https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages
Good luck.
Also check out Richard Carlson’s youtube on the topic. Someone has done the hard work! There is a demo file linked in the comments of the video. https://www.youtube.com/watch?v=vduYVZPo2WU