Skip to content

Instantly share code, notes, and snippets.

@a-b
Forked from alphashuro/alfred-kitty-applescript
Created August 3, 2023 08:00
Show Gist options
  • Save a-b/2977cb6cd113020dab94879783489ad0 to your computer and use it in GitHub Desktop.
Save a-b/2977cb6cd113020dab94879783489ad0 to your computer and use it in GitHub Desktop.
AppleScript for using Alfred with kitty
on alfred_script(q)
set cmd to q
repeat while cmd starts with space
set cmd to cmd's text 2 thru -1
end repeat
tell application "kitty" to activate
do shell script "/Applications/Kitty.app/Contents/MacOS/kitty @ --to unix:/tmp/mykitty new-window --new-tab"
tell application "System Events" to keystroke cmd
tell application "System Events"
key code 36 -- enter key
end tell
end alfred_script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment