Skip to content

Instantly share code, notes, and snippets.

@dennyweiss
Forked from jhickner/reload_chrome.sh
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save dennyweiss/0934c0945e4f0696ecd1 to your computer and use it in GitHub Desktop.
Save dennyweiss/0934c0945e4f0696ecd1 to your computer and use it in GitHub Desktop.
reload chrome from console
#!/bin/bash
exec <"$0" || exit; read v; read v; exec /usr/bin/osascript - "$@"; exit
-- the above is some shell trickery that lets us write the rest of
-- the file in plain applescript
on run argv
set targetApp to item 1 of argv
set delayInSeconds to item 2 of argv
tell application "Google Chrome"
activate
tell application "System Events"
tell process "Google Chrome"
delay delayInSeconds
keystroke "r" using {command down, shift down}
delay delayInSeconds
end tell
end tell
end tell
tell application targetApp to activate
end run
@dennyweiss
Copy link
Author

usage reload_chrome.sh 'AppName' 'delayInSeconds'

@bkh2js
Copy link

bkh2js commented Feb 7, 2015

hi,
I have executed the script above, but how can I use it. ;(

@wolph
Copy link

wolph commented Feb 12, 2015

@dennschu: I've added some default parameters to the script to make it even more convenient :)
https://gist.github.com/WoLpH/3c1b65217aa7b923f609

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment