aos key
Keystrokes and typed text
2 commands. Run aos key --help for the same list from the binary, or see every group.
Keystrokes and typed text. With --app or --title, input goes to that window without changing focus, so you keep working elsewhere. type --verify reads the text back from the app and fails if it did not arrive. --focus hands real focus over for the duration when an app ignores posted input. Key names are lower case joined with +, such as cmd+shift+s.
Commands
Section titled “Commands”aos key press
Section titled “aos key press”Press a key combination
needs a display
aos key press <combo> [--app=<name>|--title=<substring> [--focus] [--json]]| flag | values | meaning |
|---|---|---|
<combo> |
Required positional argument | |
--app |
<name> |
Optional |
--title |
<substring> |
Optional |
--focus |
Optional | |
--json |
Optional |
aos key press cmd+shift+saos key press enter --app=TextEdit # posted to the app, no focus changeaos key type
Section titled “aos key type”Type text; with –app/–title it goes to that window without needing focus
needs a display
aos key type <text...> [--app=<name>|--title=<substring> [--verify] [--focus] [--json]]| flag | values | meaning |
|---|---|---|
<text...> |
Required positional argument | |
--app |
<name> |
Optional |
--title |
<substring> |
Optional |
--verify |
Optional | |
--focus |
Optional | |
--json |
Optional |
aos key type "hello world"aos key type "hello" --app=TextEdit --verify # posted to the app, read back from its text fieldaos key type "hello" --app=Chrome --focus # real focus + verify, focus handed back after# exit 1 if --verify cannot see the text arrive; exit 3 if no window matches