How to use AppleScript send iMessage?
Does anyone know how to send iMessage by AppleScript? I tried lots of times, but still cant send an message sucessfully. I am using OS X 10.8.3.
Here is my code
tell application "Messages"
set theBuddy to buddy "mailaddressl" of service "Bonjour"
send "Hi there" to theBuddy
end tell
When I run this code, all I get
error "“Messages”got an error: Can't get“buddy id \"0B6FAA4A-0A36-4A9B-A481-807B5A946D13:mailaddress\"”. " number -1728 frombuddyid "0B6FAA4A-0A36-4A9B-A481-807B5A946D13:mailaddress"
Does anyone know how to solve this problem? Thanks!
MacBook Pro, OS X Mountain Lion (10.8.3)