Send SMS to Contacts in Excel through Automator and AppleScript
I'm trying to figure out how to send SMS texts to an Excel contact list. Others on this forum have discussed this topic in the recent past, however, the code presented does not work for me. Wondering if anyone has a proven solution.
For example, the solution Camelot offered on 12/11/2020:
on get_member(id)
tell application "Microsoft Excel"
-- assumes column 1 for the name and column 2 for the phone number
set _name to value of cell ("A" & id)
set _number to value of cell ("B" & id)
return {name:_name, number:_number}
end tell
end get_member
on send_message_to(member)
tell application "Messages"
try
send "Hello, " & name of member & ", This is text" to participant (number of member) of account "SMS"
end try
end tell
end send_message_to
set i to 2
repeat
-- go get the data for the member
set _member to get_member(i)
if name of _member = "" then
-- break on the first empty/missing name
exit repeat
end if
send_message_to(_member)
-- increment the counter
set i to i + 1
end repeat
Thanks in advance.