Hello
Since the delivery of 10.12.2, the script used to insert my signature plays the fool.
After every character defined as uppercase ones, one or several other characters defined as lowercase are inserted as uppercase.
Is it an already reported behavior ?
The active part of the script is :
set leMessage to "Yvan KOENIG running Sierra 10.12.2 in French (VALLAURIS, France)"
tell application "System Events" to tell process theApp
set frontmost to true
keystroke return & leMessage & return
end tell
where theApp is the process active when the script is executed.
If the target process is Safari, the result is :
[format]YVan KOENIG RUNNiNg SIErra 10.12.2 iN FRENch (VALLAURIS. FRance)[/format]
If the target process is Firefox, the result is:
[format]YVAN KOENIG running SIErra 10.12.2 in FrENch (VALLAURIS. FRAnce)[/format]
If the target process is TextEdit, the result is even worse:
[format]YVAN KOENIG RuNNiNg SIERra 10.12.2 In FRENCh 5VALLAURIS. FRANce)[/format]
As you may see, the problem strikes also upon the opening paren which, on french keyboard is the lowercase counterpart of the character 5 [ ⇧) → 5 ]
I was able to retrieve a correct behavior using :
set leMessage to "Yvan KOENIG running Sierra 10.12.2 in French (VALLAURIS, France)"
set leMessage to return & leMessage & return
set messageChars to text items of leMessage
tell application "System Events" to tell process theApp
set frontmost to true
repeat with aChar in messageChars
keystroke aChar
delay 0.002 # I don't understand why it was missing, probably pasted from a wrong file
end repeat
end tell
It seems that the keystroke tool type the characters too fast so that the uppercase mode remains active when the wanted lowercase chars are sent.
The signature displayed below was inserted with the edited code.
Yvan KOENIG running Sierra 10.12.2 in French (VALLAURIS, France) mercredi 14 décembre 2016 12:17:30