Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasontucker/1970a4ca9a2b5dee9ee5502e53ba2238 to your computer and use it in GitHub Desktop.
Save jasontucker/1970a4ca9a2b5dee9ee5502e53ba2238 to your computer and use it in GitHub Desktop.
-- determine if path to '~/Pictures/Screenshots' exists, if not, create it
set homeFolderPath to POSIX path of (path to home folder as string)
set screenshotStoragePath to homeFolderPath & "Pictures/Screenshots/"
tell application "System Events"
if (not (exists folder screenshotStoragePath)) then
tell application "Finder"
make new folder at (path to home folder as string) & "Pictures" with properties {name:"Screenshots"}
end tell
end if
end tell
-- save screenshot
repeat with shotcount from 1 to 100
-- initialize storage location to be used for screenshot
set timeStamp to do shell script "date '+%Y-%m-%d at %I.%M.%S %p'"
set screenshotFilePath to screenshotStoragePath & "Screen Shots " & timeStamp & " Monitor 1.png"
set screenshotFilePath2 to screenshotStoragePath & "Screen Shots " & timeStamp & " Monitor 2.png"
do shell script "screencapture" & " " & quoted form of screenshotFilePath & " " & quoted form of screenshotFilePath2
delay (60 * 2) -- 2 minutes
end repeat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment