5 ms·
Sendkeys: Command line tool for automating keystrokes and mouse events on macOS
- lukaslukas 1y agoNice. But why?
- ivanche 1y agoFor example to automate what couldn't be automated otherwise.
- supersixirene 1y agoFor example to deal with software designers that think web browsers are people
- supersixirene 1y agoThis is legend. I’ll be putting this to extensive use tomorrow.
- robterrell 1y agoYou'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}"
- eviks 1y agoHow do you stimulate delays, animation intervals, key down/ups a with System Events?
- bestham 1y agoApple Script is a programming language and you have full control flow at your disposal to wait and branch as needed.
- eviks 1y agoThis is too generic to answer this specific question. Key down, for example, is not an inherent property of a programming language. (and neither is delay precision guarantees, which might be important for some key sequences)
- robterrell 1y agoAppleScript supports the "delay" command. System Events supports both "keydown" and "keyup" in addition to keystroke.
- pkoird 1y agoWonder how this compares to Autohotkey on Windows.
- eviks 1y agoAhk isn't cli, and also is a full-blown programming language, so not as limited in its input
- biomcgary 1y agoNow to finetune my local LLM on the sendkeys syntax, add kyutai for streaming voice recognition, and my mac will be fully voice operable.