APPLESCRIPT: Keycodes double tab and enter not working

126 views Asked by At

hi I have this code to open up a program and find a documentnumber.

When I physically type the keys on my keyboard it works.

I just need to fix the following code, instead off typing, through code creating the keycodes :

tab tab enter

So I made this:

tell application "System Events"
    key code 48
    key code 48
    key code 76
end tell

This should work right?

1

There are 1 answers

1
Ted Wrigley On

It should work, but it doesn't seem to. Not sure why that is...

Try this instead:

tell application "System Events"
    keystroke tab & tab & return
end tell