blysik wrote:It's a shell script that runs AppleScript:
- Code: Select all
#!/bin/bash
curl -s http://user:pass@192.168.55.218/Streaming/channels/1/picture > /tmp/8.jpg
osascript <<EOD
tell application "Messages"
set targetBuddy to "+PHONENUMBERHERE"
set targetService to id of 1st service whose service type = iMessage
set myFile to "/tmp/8.jpg"
set DestFile to (POSIX file myFile) as string
send file DestFile to buddy targetBuddy of service id targetService
end tell
EOD
The mac this runs on is logged into an Apple iMessages account already and has iMessages open.