1
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.

Iceman
  • 365
  • 1
  • 3
  • 13
  • Looks to be a bug `0 :-)Tue Jan 03 22:41:26 anurag@Iceman's Mac mini ~ $ echo 'tell application "System Events" to keystroke "B" & "a"'|osascript BA` – Iceman Jan 03 '17 at 17:14
  • Does this answer your question? [AppleScript keystroke sometimes capitalizing letters?](https://stackoverflow.com/questions/41227700/applescript-keystroke-sometimes-capitalizing-letters) – NiMa Thr Aug 03 '21 at 00:45

1 Answers1

0

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
Mark Setchell
  • 191,897
  • 31
  • 273
  • 432