Last active
January 3, 2016 12:42
-
-
Save dnlcrl/c11887a8ebcb6390c3cc to your computer and use it in GitHub Desktop.
Capture an image and send it with iMessage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/osascript | |
set rec to "1234567890" | |
set appleid to "E:[email protected]" | |
set today to current date | |
set currentDayNumber to day of today as string | |
set currentMonthName to month of today as string | |
set currentYear to year of today as string | |
set theDate to (currentMonthName & " " & currentDayNumber & ", " & currentYear & ".") | |
set theTime to time string of (current date) | |
set mssg to "Script Started at " & theTime & ", " & theDate | |
do shell script "/usr/local/bin/imagesnap ~/snapshot.jpg" | |
set theAttachment to POSIX file ((system attribute "HOME") & "/snapshot.jpg" as text) | |
tell application "Messages" | |
activate | |
send mssg to buddy rec of service appleid | |
send theAttachment to buddy rec of service appleid | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment