Skip to content

Instantly share code, notes, and snippets.

@bradley219
Created August 27, 2018 15:12
Show Gist options
  • Save bradley219/697cb470637119683c77b6edc586dbb3 to your computer and use it in GitHub Desktop.
Save bradley219/697cb470637119683c77b6edc586dbb3 to your computer and use it in GitHub Desktop.
# Usage:
# osascript sendimessage.applescript <recipient> <message>
on run {targetBuddyPhone, targetMessage}
tell application "Messages"
set targetService to 1st service whose service type = iMessage
set targetBuddy to buddy targetBuddyPhone of targetService
send targetMessage to targetBuddy
end tell
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment