Skip to content

Instantly share code, notes, and snippets.

@sydneyitguy
Created April 19, 2020 15:24
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 sydneyitguy/4f163ecf557fff78d74f29bed7e9725a to your computer and use it in GitHub Desktop.
Save sydneyitguy/4f163ecf557fff78d74f29bed7e9725a to your computer and use it in GitHub Desktop.
Refresh Chrome every 120 seconds and take screenshot
#!/bin/sh
exec <"$0" || exit; read v; read v; exec /usr/bin/osascript - "$@"; exit
# The line above allows the rest of the file to be written in plain AppleScript.
repeat 99999999 times
tell application "Google Chrome"
activate
tell application "System Events"
tell process "Google Chrome"
keystroke "r" using {command down, shift down}
end tell
end tell
end tell
delay 10
do shell script ("screencapture ~/Desktop/$(date +%Y-%m-%dT%H%M).png")
delay 120
end
tell application "Terminal" to activate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment