Hi, I’ve been trying to use this new (for me) command, “keystroke” but found a bit of a problem in the process. I guess it’s self explanatory:
tell application "System Events"
keystroke "Hi Nik!"
end tell
--> Ha Nak!
Which is pretty confusing!! I have tried other keys and the alphabet works ok, all but “i” (“I” returns “a” also, not capital though). Numbers also work, and I haven’t tried the rest. Any ideas? Bug? Error? Ways around?
Using ASCII Character 105 doesn’t work either, still returns “a”.
Yes, this is a known bug…
Meanwhile, you can take a look to Kanzu’s Extra Suites. It is $10, but if you take a look to its dictionary, it’s a pretty cheap tool!
[quote=“Greg Spence”]
Nikel, on my machine it returns the correct characters…
tell application "System Events"
keystroke "Hi Nik!"
end tell
--> Hi Nik!
If I recall correctly, someone (maybe Nikel) once mentioned this problem on Apple’s AppleScript forum. I don’t think that anyone was ever able to resolve the issue and I couldn’t reproduce the problem on my machine. :?