I created hundreds of macros to control Reason Studios Reason 12, which is triggered using Stream Deck XL. They all work but not all the time. Essentially, I have KM control many functions that are in the menus by looking for the matching name (I rarely use their shortcut). But often I get KM DIalog boxes that will say the menu item cannot be found, even though it is clearly in the Reason menu. Triggering the macro again often will make it work. Any ideas? I'm attaching snapshots of the KM Dialog popup error box, the actual macro that is attempting to select the matching menu item from the specified menu, and a snapshot of the actual Reason menu showing the item name is there and matches what I'm trying to select with KM. Weirdly, trying again or twice in a row will often make it work. Am I not coding this correctly? The Reason app does have 3 possible separate windows open so at first, I thought it was a mouse focus issue, but even on the correct window, I can can get the KM error dialog box. Note that every macro begins with Activating Reason to be sure KM is talking to the right open app.
As it happens, many menus for many applications don't actually exist (aren't populated) until the user clicks on them and they visibly show up on the screen. I'm not sure if the flaw is in the app or in macOS. This is probably why when you "try twice in a row" it works - because the first time it tried, it wasn't actually there, but then it populated the menu.
Shortcuts will probably work every time. Are you willing to switch to them?
Another possible solution is to slow down the process by clicking on the major menu item first, followed by the submenu, using two separate actions. This should force the menu to become populated.
Thanks! I will try your menu suggestion. What is the best way to access a menu first before I start selecting the target menu name?
I did not want to use the assigned shortcuts because there are too many menu items without a shortcut, and people who tried creating shortcuts via macOS would eventually run out. As it stands, I have created over 700+ macros because I wanted to control everything! It's awesome paired with Stream Deck XL and multiple linked Profiles... if it would just work consistently!
I believe I read in another thread here somewhere (way too late and vague to try to find it now!) that if you simply have KM click in the menu bar, on a menu bar item, that will force them to populate. So you could simulate the mouse click before your menu commands, and in theory, that should help.
Nope, still get the error occasionally. It seems to be related to the fact that there are 3 window panes open and displayed across two monitors. The error seems to occur if operating on the unselected window pane. Select that pane, first, and it seems to be OK (This may be analogous to the suggestion of having KM click on the menu bar to activate menus). But as selecting the window pane is not always helping, I will next attempt to have KM activate the menu bar.
I tried having the mouse pointer click on the top menubar to see if that helped bootstrap populating the menus, but I still occasionally got the error dialog. After looking for a common denominator on the actions that sometimes errored, I determined that these were Steam Deck's multi-action round-robin "state" toggles, i.e. "Show", then "Hide" with each subsequent button press, which always executes in the same order, i.e. Show, then Hide, then Show, etc. Additionally, the Reason Menu system is dynamic and only displays the "Hide" option if the item is currently displayed, and vice versa. Thus, if the Stream Deck's multi-action button triggers a state that is currently NOT displayed in the Reason menu, well, duh... there's the problem! The solution is easy: just disable "notify on failure" for all the macros that are used in Stream Deck multi-action buttons. Now, if I press a multi-action button and the state does not match, it can't trigger anything because it can't find a matching name in the dynamic menu. But press again (the natural reaction) and voila, the states match and KM triggers the right action. No need to confuse the user with an error dialogue popup. Problem solved! Thank you all for giving me insights about the menu.
If you want to toggle a menu, you can usually have the Select a Menu Item action choose from the set of options by separating the options with a bar (|) as described.
Wow, thank you! It's working! Plus I did disable the error dialogue on the state macros just for good measure. But so far, everything is working! I love KM Really appreciate everyone's help!