Skip to content

Instantly share code, notes, and snippets.

@andytwoods
Last active January 11, 2022 14:19
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 andytwoods/62eb9d7ba1d2326ca1dac57e83fcd133 to your computer and use it in GitHub Desktop.
Save andytwoods/62eb9d7ba1d2326ca1dac57e83fcd133 to your computer and use it in GitHub Desktop.
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "r", function()
local current_focus = hs.application.frontmostApplication();
hs.application.launchOrFocus('Google Chrome');
local browser = hs.appfinder.appFromName('Google Chrome')
hs.timer.doAfter(.5, function()
hs.eventtap.keyStroke({"cmd"}, "r", 1000, browser);
local current_focus_name = current_focus:name();
hs.timer.doAfter(.5, function()
hs.application.launchOrFocus(current_focus_name);
end)
end
)
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment