In the above formula, once a particular Criteria is found to be true, the corresponding Action is executed and the formula stops. If none of the Criteria are true, the formula sends a backtick ("`").
Note: I am a quadriplegic with paralyzed hands. As a result, I have AHK scripts written for almost every conceivable action and generally have several hundred of them, each with its own hotkey, running at the same time. That creates the problem of having and remembering a large number of hotkeys.
What I would like to do is, for a given Hotkey, set up multiple Actions with the Action being executed dependent on which window is active.
So for example, let's say the Hotkey is F2, the script would look something like this (I know the following is not a real script but hopefully it conveys what I am after):
In this way, and assuming I can get a given Hotkey's script to stop once it finds the active window, I could have a single hotkey trigger multiple different macros depending simply on which window is currently active.
So, what I'm imagining is a "table" (array) of data in AHK that has three columns, KEY, WINDOW, ACTION. Then when a key is pressed the handler for that keypress is activated in AHK and it looks up the key and current window in this table, and then invokes the specified action. Seems like it might be easier to implement and maintain, but again, I can't propose actual AHK code and can't speak to any limitations that would make this difficult.
I'm sure Joe can add some thoughts.