News for hackers. Stuff that matters.
Re:Sendkeys: Command line tool for automating keystrokes and... by supersixirene on Sunday July 06, 2025 @04:31PM (#44483781)
This is legend. I’ll be putting this to extensive use tomorrow.
Re:Sendkeys: Command line tool for automating keystrokes and... by robterrell on Sunday July 06, 2025 @06:37PM (#44484747)
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}"
Re:Sendkeys: Command line tool for automating keystrokes and... by eviks on Sunday July 06, 2025 @10:58PM (#44486334)
How do you stimulate delays, animation intervals, key down/ups a with System Events?
Re:Sendkeys: Command line tool for automating keystrokes and... by bestham on Monday July 07, 2025 @02:09AM (#44487231)
Apple Script is a programming language and you have full control flow at your disposal to wait and branch as needed.
Re:Sendkeys: Command line tool for automating keystrokes and... by eviks on Monday July 07, 2025 @02:22AM (#44487294)
This 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)

Re:Sendkeys: Command line tool for automating keystrokes and... by robterrell on Monday July 07, 2025 @06:39PM (#44495313)
AppleScript supports the "delay" command. System Events supports both "keydown" and "keyup" in addition to keystroke.