Created
March 14, 2019 13:56
-
-
Save mikew/d75c2dbb636dd5ba81d6be960540f905 to your computer and use it in GitHub Desktop.
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
on run argv | |
set appToLaunch to (item 1 of argv) | |
tell application "System Events" | |
set activeApp to bundle identifier of first process whose frontmost is true | |
end tell | |
if appToLaunch is equal to activeApp then | |
tell application "System Events" to keystroke "`" using command down | |
else | |
do shell script "open -b " & appToLaunch | |
end if | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment