Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
New Kitty terminal window global hotkey on Mac OSX
# Open a new kitty terminal window on MacOS
# 1. Copy this script into AppleScript Editor and save it somewhere
# 2. Use something like Apptivate to run the script on a global hotkey:
# Note this script doesn't work well as a Service through Automator as the
# "click menu" functionality requires accessibility privileges granted.
# Services run as the focused app, so that setup would require every context
# the shortcut is run from to have accessibility granted.
on is_running(appName)
tell application "System Events" to (name of processes) contains appName
end is_running
if not is_running("kitty") then
tell application "kitty" to activate
tell application "System Events" to tell process "kitty"
click menu item "New OS Window" of menu 1 of menu bar item "kitty" of menu bar 1
end tell
end if
Copy link

madx commented Feb 23, 2022

Thanks for your snippet! It's exactly what I was looking for, I just had to change the menu bar item name to Shell as it has changed in recent versions I guess

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