Question about AppleScript to automate messages
Hi, I'm trying to modify the following code that posted by @Camelot to the community with no luck with my current knowledge.
Instead of fixed message, I'm trying to add the following line to the code so the script will read column c (or multiple columns) in excel that contain the actual message however I'm not able to return the value and add this to the message body. Also I'm not able to figure out how to use iMessage service only.
Thank you for your advise
set _msg1 to value of cell ("C" & id)
return {name:_name, number:_number, message:_msg1}
send "Hello " & name of member & ", " & message to participant (number of member) of account "iMessage"
Original Code:
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
MacBook Air