Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

honeycombz

macrumors 6502a
Original poster
Jul 6, 2013
592
155
Anyone know how I could have screenshots taken automatically at certain times and then sent to me via email or some command line upload thing?
 
Neat. I will check this out. So far I was trying to just use straight screencapture command and have the following which takes a screenshot every 60 seconds...

Bash:
while true; do screencapture ~/Desktop/test-`date -Iseconds | tr -d :`.png; sleep 60; done

but it would be cool to be able to upload it via sftp or email it or send it somewhere remotely, in addition to delete them if you acquire more than 10 or something. Anyone know how I could accomplish this? I am new to this scripting stuff.
 
I was trying something like this but when I get sent the image it is just a bunch of encoded characters anyone know anything about sending an image as an attachment via curl?

Bash:
screencapture -T 5 -C ~/screencap1.png

curl --url 'smtps://smtp.gmail.com:465' --ssl-reqd \
  --mail-from 'myemail@gmail.com' \
  --mail-rcpt 'youremail@gmail.com' \
  --user 'myemail@gmail.com:app-password' \
  --upload-file '/Users/username/Desktop/screencap1.png' \
  -T <(echo -e 'From: myemail@gmail.com\nTo: youremail@gmail.com\nSubject: Curl Test\n\nHello')
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.