It's probably best if I explain what I'm trying to do, and why.
I'm using REAPER (DAW, for audio work). Anytime I accidentally have the Media Item Properties window focused, if I press various keystrokes/hotkeys, I unintentionally might change properties for a number of selected sounds without realizing I've done so, thinking that the keystrokes i pressed are being sent to the main edit window instead.
What I'm hoping I can do: assign a macro that gets executed conditionally by a script to change the frontmost window before sending the pressed keystroke(s) to the REAPER app.
- the first condition would check if the frontmost window name matches "Media Item Properties", which I'm hoping I could somehow execute anytime the current app is REAPER, and the name of the frontmost window changes.
- the second condition would be checking if the keystroke(s) pressed once the first condition is true match any in an editable variable array containing all the keystrokes/hotkeys I want to use this macro to filter.
- If the pressed keystroke/hotkey is in the array, the macro will first run a macro to focus the main window in REAPER (i have this already), and then send the pressed keystroke/hotkey to the REAPER app via use of the
%TriggerValue%variable (or, in case that won't work in this context, some other variable the matched keystroke/hotkey pressed gets assigned to).
i think this would be much easier/more efficient than adding a ton of hotkeys to the trigger conditions of a 'frontmost window validation' macro, some of which would also be triggers for other macros, which would then bring up the conflict palette.
my hope is, if this macro is already running when the frontmost window changes, and I'm using applescript or some other method to catch keyboard input if the Media Item Properties window is frontmost at that point (and/or possibly just disabling other macros until keyboard input is processed by this macro/script), then it would basically allow me to run this macro before any other macros could be triggered by various hotkeys.
if anyone has any suggestions on how to best accomplish this, or knows if such a thing would even be possible with KM, please share the info. Thanks!
PS: it's probably important to mention that I'm on an older system (macOS Sierra 10.12.6, running KM 9.2), which may impose some limitations i wouldn't have if i were on a newer system & KM version.



