Created
November 28, 2008 20:44
-
-
Save mkhl/30086 to your computer and use it in GitHub Desktop.
When using Terminal.app, hide it, otherwise switch to it
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
tell application "System Events" | |
if exists application process "Terminal" then | |
set terminalProcess to application process "Terminal" | |
if frontmost of terminalProcess then | |
tell terminalProcess to set visible to false | |
else | |
tell terminalProcess to set frontmost to true | |
end if | |
else | |
tell application "Terminal" | |
launch | |
activate | |
end tell | |
end if | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment