Version 0.7.6 adds a lastAnimGif Variable to Indigo - this contains the local path of the last create Animated gif. Hence this can be used to send a iMsg when any Camera triggers with the following:
Ok - slightly more complicated than sending a file
- Code: Select all
set varValueJson to do shell script "curl -u indigouser:indigopassword --digest http://IndigoIP:8176/variables/lastAnimGif.json"
tell application "JSON Helper"
set varValueRecord to read JSON from varValueJson
set varValue to value of varValueRecord
end tell
set theAttachment to POSIX file varValue
tell application "Messages"
set myid to get id of first service
set theBuddy to buddy "toemail@address" of service "E:fromemailaddress"
send theAttachment to theBuddy
end tell
The First 4-5 lines reads the variable from Indigo (using Curl) as no Indigo to Applescript support in 7.2.
It then reads the JSON file with 'JSON Helper' and gets the path.
We then set 'theAttachment' variable to the file itself - this is important.
Next we get Applescript to send the attachment to the Selected Buddy from Local Mac Account.
Hence this script can be called anytime (after suitable seconds of delay) a camera triggered and will serve up the most recent Animated Gif from any Camera!
Glenn