System Events troubles..
  • Whenever I try to do this:

    tell application \"Safari\" to activate

    tell application \"System Events\"
    tell application process \"Safari\"
    keystroke \"a\" using {command down}
    end tell
    end tell

    In Script Editor, and from the FastScripts menu, that code works perfectly. When I bind it to a FastScripts hotkey and try to run it, I just get a beep, and nothing happens.

    I wonder if this is somehow related to my other post because like that issue, the behavior is different from "the norm" only when using a FastScripts hotkey.

    Any ideas? Is there a FastScripts error log I can view?

    (I'm using FastScripts 2.2.6)

    - Cowboy
  • Cowboy - what's happening is your script is running so quickly (Bravo FastScripts) that your modifier keys are probably still held down from when you hit the keystrokes for your script. So when you get to Safari and it presses "Cmd-A" for you, there is also another modifier key (whatever you've defined) being held.

    This is also the root cause of your other issue, which I'll comment on separately on that post.

    Daniel
  • Is there a way to tell FastScripts to just run certain scripts when you've released the hotkey trigger? Or is there a way to tell my script to wait until the key is released, or do I have to tell it to sleep for an arbitrary time?

    - Cowboy
  • For the moment I think you have to either choose a different keyboard combo, or else tell it to wait for an arbitrary delay.

    I will look into the possibility of adding key-up triggered scripts in the future.

    Daniel
Start a New Discussion

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!