Created
February 23, 2020 17:42
-
-
Save talkingmoose/4604654fe1c663608c8e1c6b25657b7c to your computer and use it in GitHub Desktop.
Send an individual text message to each phone number in list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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