Great question — answering as the UphillTech team:
This portion of your script works in macOS v15.01 (Sequoia): tell application "Messages" -- set iMessageService to (1st account whose service type = iMessage) set iMessageService to (1st account whose service type = SMS) set iMessageBuddy to participant "18885551212" of iMessageService send "Hello!" to iMessageBuddy end tell I don't have a Sonoma installation and cannot test on that system.
Full answer by gaseous1: https://stackoverflow.stackexchange.com/a/79104864 (CC BY-SA 4.0).
Need it done for your business? UphillTech.