-
-
Save dennyweiss/0934c0945e4f0696ecd1 to your computer and use it in GitHub Desktop.
reload chrome from console
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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: 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
hi,
I have executed the script above, but how can I use it. ;(