This Gist provides a solution to periodically capture screenshots of your Mac, and create therefrom a searchable PDF archive so that you can always get an answer to the “what, when, and where” questions about your usages.
To use these scripts:
-
Download the shell script
rewind
, then:-
put it under
~/bin
(or other fixed path you prefer); -
execute
chmod +x ~/bin/rewind
in Terminal to grant the execute permission;
-
-
Download the
xyz.cyhsu.script.rewind.plist
, then:-
put it under
~/Library/LaunchAgents/
; -
(REQUIRED) change the value of the key
array
in line 9 to the absolute, full path of therewind
script.N.B. No env or
~
will be interpolated by launchd;
-
-
Install OCRmyPDF with Homebrew:
brew install ocrmypdf
and download the necessary dataset from GitHub, which should be put under one of the following paths:
- Apple silicon models:
/opt/homebrew/Cellar/tesseract/[VERSION]/share/tessdata/
- Intel models:
/usr/local/Cellar/tesseract/[VERSION]/share/tessdata/
- Apple silicon models:
-
Select Apple menu > System Settings, then go to Screen Recording under Security and Privacy.
There, click the add button, and ensure all following items are added to the list:
/bin/bash
/System/Library/CoreServices/launchservicesd
/usr/sbin/screencapture
-
Execute
launchctl load ~/Library/LaunchAgents/xyz.cyhsu.script.rewind.plist
in Terminal to load the agent.
Thereafter, you can find timestamped, OCR’d screenshots in PDF format under ~/Pictures/Rewind
.
The default period is 30 seconds.
Multiple-display setup is supported and screenshots will be captured for each display.
A detailed description of this method is available at https://sspai.com/prime/story/rewind-diy (paywalled). If you find these scripts helpful, you may consider a subscription as support. Thank you.