AppleScript to send iMessage
Hey, i'm writing the following applescript to send (to myself) an alarm by iMessage when some criteria happen
launchapplication "Messages"
tell application "Messages"
activate--steal focus
set targetBuddy to "myemail@icloud.com"
set targetService to id of service "E:myemail@icloud.com"
set textMessage to "Just a test"
set theBuddy to buddytargetBuddy of serviceidtargetService
sendtextMessagetotheBuddy
end tell
When i launch
tell application "Messages"
get name of every service
end
i receive
{"Bonjour", "SMS", "E:myemail@icloud.com"}