Search code examples
applescriptkeystroke

AppleScript : keystroke : too slow


The keystroke on my script take around 5/7 seconds until going to the next step. I didn't set any delay.

E.g :

-- Click 1
    click pop up button 1 of group 2 of group 2 of group 1 of group 2 of group 6 of group 2 of group 1 of group 4 of UI element 1 of scroll area 1 of group 1 of splitter group 1 of window 1
    keystroke "Edit"
    keystroke return
    -- Click 2
    click pop up button 1 of group 2 of group 1 of group 1 of group 2 of group 2 of group 6 of group 2 of group 1 of group 4 of UI element 1 of scroll area 1 of group 1 of splitter group 1 of window 1
    keystroke "Standard"
    keystroke return

So basically, its clicking, show the Click Pop up button, wait 7 secondes, then continue the script.

Any idea?


Solution

  • Don't get your hopes up, but you can try to wrap problem lines in time out or ignoring application responses.

    try
        with timeout of x seconds
            --
        end timeout
    end try
    

    .

    ignoring application responses
        --
    end ignoring