Skip to content

Instantly share code, notes, and snippets.

@antonellopasella
Last active February 20, 2019 19:09
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save antonellopasella/5212407 to your computer and use it in GitHub Desktop.
Save antonellopasella/5212407 to your computer and use it in GitHub Desktop.
How to send a new iMessage throug Applescript. For retrieve the contactname select your contact from list then SHIFT+CMD+I
tell application "Messages"
set isAppRunning to false
tell application "System Events"
if (exists process "Messages") then
set isAppRunning to true
end if
end tell
if isAppRunning is false then
activate
end if
set theBuddy to buddy "contactname@imac-di-contactname" of service "bonjour"
send "test" to theBuddy
end tell
@tongyi0225
Copy link

Hi, brother, I have a question, if I haven't anyone in my contact, this applescript can't select from list, so this script is error. I have a maillist, I want to batch send imessage, how to do it?

@SniperQian
Copy link

what is the "bonjour" to fill in? My mac service?

@DavyLin
Copy link

DavyLin commented Jun 9, 2014

Hi,I want to get the result of send message, success or fault. how can i do?Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment