Skip to content

Instantly share code, notes, and snippets.

@chrisbodhi
Created May 19, 2023 22:30
Show Gist options
  • Save chrisbodhi/f8f038e2978f945a05210d76c1bc4281 to your computer and use it in GitHub Desktop.
Save chrisbodhi/f8f038e2978f945a05210d76c1bc4281 to your computer and use it in GitHub Desktop.
Work with the garage door up: this script snapshots your entire desktop through the day, and then stitches the images together into a gif
--Requires ImageMagick
-- Set up the variables
set screenshotFolder to "/Users/YR_NAME/Desktop/Screenshots" -- Change this to whatever folder you'd like to save the screenshots in
set screenshotInterval to 600 -- Change this to the number of seconds between each screenshot
set screenshotCount to 30 -- Change this to the number of screenshots you'd like to take
-- Take the screenshots
delay screenshotInterval
repeat with i from 1 to screenshotCount
set screenshotName to "screenshot" & i & ".png"
set screenshotPath to screenshotFolder & "/" & screenshotName -- corrected file path
do shell script "screencapture -x " & quoted form of screenshotPath
delay screenshotInterval
end repeat
-- Combine the screenshots into a gif
set gifName to "screenshot.gif"
set gifPath to screenshotFolder & gifName
do shell script "cd " & quoted form of screenshotFolder & "; /opt/homebrew/bin/convert -delay 100 -loop 0 screenshot*.png " & quoted form of gifName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment