• Take a screenshot every 1-2 minutes.
  • It might be very useful.
  • Benefits:
    • When writing code, you can refer back to a screenshot if you want to restore something you deleted a few minutes ago but can’t remember what it was.
      • Same goes for writing articles.
    • Even if your written text accidentally gets deleted, you can restore it by referring to the screenshot.
  • Drawbacks:
    • It’s very insecure from a security standpoint.
      • It records all sensitive information that could be leaked.
        • Moreover, because Gyazo is convenient, it allows for searching through OCR.
      • Is there any way to make it secure?

Procedure:

  • Execute the following regularly using launchd:
  • It seems that Gyazo performs better OCR on smaller images even with the same resolution.
    • I wonder if they resize larger images before applying OCR.

Note: The script assumes a two-screen setup. .scpt

tell application "System Events"
    set activeApps to name of application processes whose frontmost is true
    set activeApp to item 1 of activeApps
end tell
set activeApp to do shell script "echo " & quoted form of activeApp & " | sed -e 's/ /_/g'"
set shotTime to do shell script "date +\"%Y-%m-%d_%H:%M \" | awk '{$1=$1;print}'"
do shell script "screencapture -x ~/Desktop/Auto_Screenshots/001.png ~/Desktop/Auto_Screenshots/002.png "
do shell script "/usr/local/bin/convert +append ~/Desktop/Auto_Screenshots/001.png ~/Desktop/Auto_Screenshots/002.png ~/Desktop/Auto_Screenshots/merged.png"
delay 1
do shell script "curl -X POST -i \"https://upload.gyazo.com/api/upload?access_token=&desc=" & shotTime & "_Screenshot&app=" & activeApp & "\" -F imagedata=@/Users/bluemountain/Desktop/Auto_Screenshots/merged.png"