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}"(and neither is delay precision guarantees, which might be important for some key sequences)
lukaslukas•7mo ago
ivanche•7mo ago
supersixirene•7mo ago