Skip to content

Instantly share code, notes, and snippets.

@roldershaw
roldershaw / imsg
Last active March 1, 2022 19:34
Send iMessages from the command line using Bash and AppleScript
#!/bin/bash
if [ -z "$1" ] || [ -z "$2" ] ; then
echo "Usage: imsg [address] [message]"
else
/usr/bin/osascript -e 'tell application "Messages"
send "'"$2"'" to buddy "'"$1"'" of service "E:you@icloud.com"
end tell'
echo "Sent"
fi