Posts

Showing posts with the label Applescript

Apple - AppleScript Keystroke Ignoring Numbers

Answer : Have a look at https://stackoverflow.com/questions/18136567/applescript-keystroke-not-behaving-as-expected & the list of ANSI codes at How do I automate a key press in AppleScript? It appears you're not the only one with the issue. One solution on there was to use the key code instead... tell application "System Events" key code {18} using {command down} It may depend on what app you're trying to send the keystrokes to - I just tested with an already-open blank document in Text Edit using tell application "TextEdit" to activate tell application "System Events" keystroke "abc 123" end tell & it worked as expected. A keystroke is the scripted equivalent of actually pressing that/those keys[s] How about... tell application "TextEdit" to activate tell application "System Events" keystroke "abc" keystroke space keystroke "123" end tell Some more ...