Last active
January 11, 2022 14:19
-
-
Save andytwoods/62eb9d7ba1d2326ca1dac57e83fcd133 to your computer and use it in GitHub Desktop.
This file contains 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
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