Sendkeys: Command line tool for automating keystrokes and mouse events on macOS

19 nateb2022 5 7/6/2025, 4:10:34 PM github.com ↗

Comments (5)

supersixirene · 4h ago
This is legend. I’ll be putting this to extensive use tomorrow.
robterrell · 2h ago
You've always had this ability, but with more convoluted syntax:

  osascript -e "tell application \"System Events\" to keystroke \"whatever\""
Specify the application too with multiple -e parameters. This will copy whatever is selected in Safari:

  osascript -e "tell application \"Safari\" to activate" -e "tell application \"System Events\" to keystroke \"c\" using {command down}"
lukaslukas · 5h ago
Nice. But why?
ivanche · 4h ago
For example to automate what couldn't be automated otherwise.
supersixirene · 4h ago
For example to deal with software designers that think web browsers are people