Skip to content

Instantly share code, notes, and snippets.

@jhickner
Created November 15, 2012 22:37
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save jhickner/4081943 to your computer and use it in GitHub Desktop.
Save jhickner/4081943 to your computer and use it in GitHub Desktop.
Reload Chrome then refocus iTerm
#!/bin/sh
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
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
tell application "iTerm" to activate
@dennyweiss
Copy link

I have extended your script with params for app name and delay (that solves issues with PhpStorm, when used as external tool with keyboard shortcut) see https://gist.github.com/dennschu/0934c0945e4f0696ecd1

@jamesarmenta
Copy link

Perfect! This is awesome, thanks. 👍

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