I am trying to simulate pressing the key 1 within a Java application. I have tried using key code 18, text to type, key down and keystrokes but whatever I try, the application displays the a
character. Even when the script types into applescript window I just get aaaaaaa
.
What am I doing wrong and how to properly simulate keypresses with AppleScript?