Skip to content

Instantly share code, notes, and snippets.

@xenopus
Created January 12, 2017 08:31
Show Gist options
  • Save xenopus/552f944ce60c0dcccf1dae0182b99ecd to your computer and use it in GitHub Desktop.
Save xenopus/552f944ce60c0dcccf1dae0182b99ecd to your computer and use it in GitHub Desktop.
AppleScript for Terminal.app to work like Visor.
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