Skip to content

Instantly share code, notes, and snippets.

@rbreaves
Created July 20, 2022 18:17
Show Gist options
  • Save rbreaves/878f8b75a24addd50f5212566036395b to your computer and use it in GitHub Desktop.
Save rbreaves/878f8b75a24addd50f5212566036395b to your computer and use it in GitHub Desktop.
Allow macOS to toggle Terminal window on hotkey
set appName to "Terminal"
tell application "System Events"
if visible of application process appName is true then
set visible of application process appName to false
else
set visible of application process appName to true
set frontmost of application process appName to true
end if
end tell
@rbreaves
Copy link
Author

rbreaves commented Aug 4, 2022

Automator -> New Document

Quick Action -> Workflow receives: no input - on: any application -> Add Applescript, paste above code (& replace existing template code) -> Save as Toggle Terminal

Open Settings -> Keyboard -> Shortcuts -> Services -> Set hotkey combo for Toggle Terminal (suggested Ctrl+Shift+~)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment