-
-
Save yqrashawn/e4470786005308b198002b14a348790c to your computer and use it in GitHub Desktop.
apple script toggle application visibility
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
set appName to "Emacs" | |
set appID to bundle identifier of (info for (path to application appName)) | |
tell application "System Events" | |
if not (exists process appName) then | |
tell application appID to activate | |
else | |
if frontmost of process appName then | |
set visible of process appName to false | |
else | |
set frontmost of process appName to true | |
end if | |
end if | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment