Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save talkingmoose/4604654fe1c663608c8e1c6b25657b7c to your computer and use it in GitHub Desktop.
Save talkingmoose/4604654fe1c663608c8e1c6b25657b7c to your computer and use it in GitHub Desktop.
Send an individual text message to each phone number in list.
tell application "Messages"
-- phone numbers must already exist in Contacts
set phoneNumbers to {"6125550000 John Smith", ¬
"6125551111 Mary Poppins", ¬
"6125552222 Larry Bud Melmon"}
-- https://stackoverflow.com/questions/11812184/how-to-send-an-imessage-text-with-applescript-only-in-provided-service
repeat with aNumber in phoneNumbers
set targetService to (1st service whose service type = iMessage)
set targetBuddy to buddy (word 1 of aNumber) of targetService
send "This is a test text..." to targetBuddy
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment