Created
January 12, 2017 08:31
-
-
Save xenopus/552f944ce60c0dcccf1dae0182b99ecd to your computer and use it in GitHub Desktop.
AppleScript for Terminal.app to work like Visor.
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
on run {input, parameters} | |
set termWinCnt to 0 | |
tell application "Terminal" | |
if it is running then | |
set termWinCnt to number of windows | |
if termWinCnt = 0 then | |
reopen | |
else | |
tell application "System Events" | |
if visible of application process "Terminal" = false then | |
set visible of application process "Terminal" to true | |
tell application "Terminal" to activate | |
else | |
set visible of application process "Terminal" to false | |
end if | |
end tell | |
end if | |
else | |
activate | |
end if | |
end tell | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment