Live data from Hacker News

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

github.com

1–10 of 13 posts

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

#6

This is legend. I’ll be putting this to extensive use tomorrow.

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 mouse events on macOS

#10

This is legend. I’ll be putting this to extensive use tomorrow.

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}"

How do you stimulate delays, animation intervals, key down/ups a with System Events?
Post reply on HN