Applescript keystroke capitalises some characters

282 views Asked by At
127  ;-(Tue Jan 03 22:27:09 Mac mini  ~
$   echo 'tell application "System Events" to keystroke "Changeme@123"'|osascript
CHAN

0  :-)Tue Jan 03 22:27:17 Mac mini  ~
$  CHANgeme@123

$  zsh
Mac mini% echo 'tell application "System Events" to keystroke "Changeme@123"'|osascript

CHa%
Mac mini% CHaNgeme@123

Any idea what is causing some letters to get capitalized ?This seems to happen if the first character is in uppercase.

1

There are 1 answers

0
Mark Setchell On

Not sure why, but this works if you want a temporary work-around:

#!/bin/bash
osascript <<EOF
tell application "System Events" to keystroke "C"
tell application "System Events" to keystroke "h"
tell application "System Events" to keystroke "a"
tell application "System Events" to keystroke "n"
tell application "System Events" to keystroke "g"
tell application "System Events" to keystroke "e"
tell application "System Events" to keystroke "M"
tell application "System Events" to keystroke "e"
tell application "System Events" to keystroke "@"
tell application "System Events" to keystroke "1"
tell application "System Events" to keystroke "2"
tell application "System Events" to keystroke "3"
EOF