Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
@dennschu

This comment has been minimized.

Copy link
Owner Author

commented Sep 3, 2014

usage reload_chrome.sh 'AppName' 'delayInSeconds'

@bkh2js

This comment has been minimized.

Copy link

commented Feb 7, 2015

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

@WoLpH

This comment has been minimized.

Copy link

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
You can’t perform that action at this time.