any reason why this script isn't working?



tell application "Messages"
send "Hello, this is a test" to "rocco@musicbyrocco.com"
end tell


This script does open Messages, but it returns an error about not being able to convert rocco@musicbyrocco.com into typable buddy or chat, or something like that. What am I doing wrong?

Thanks,

Rocco

Hi,

you’re going to send a literal string to a literal string.
As the error message reveals you can send a message only to a buddy or chat,
for example


tell application "Messages"
	set theBuddy to 1st buddy whose handle is "rocco@musicbyrocco.com"
	send "Hello, this is a test" to theBuddy
end tell