Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

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"}

Posted on Nov 23, 2015 4:52 AM

Reply
1 reply

AppleScript to send iMessage

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.