Skip to content

Instantly share code, notes, and snippets.

@homebysix homebysix/send_imessage.sh
Last active Jul 31, 2016

Embed
What would you like to do?
send_imessage.sh
#!/bin/bash
RECIPIENT="+14155551212"
MESSAGE="Hello world"
cat << EOF > /tmp/send_imessage.scpt
tell application "Messages"
set serviceID to get id of first service
set theRecipient to buddy "${RECIPIENT}" of service id serviceID
send "${MESSAGE}" to theRecipient
end tell
EOF
osascript /tmp/send_imessage.scpt
rm -f /tmp/send_imessage.scpt
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.