Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hynnet/ed14dbc43ebe06e6b4548adef17e29de to your computer and use it in GitHub Desktop.
Save hynnet/ed14dbc43ebe06e6b4548adef17e29de 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment