Having tried everything we could imagine from my first post, can anybody guess at why Finale software can correctly identify key modifiers with a menu item selected manually with a mouse, but can't detect them when a menu is selected with KM?
The Select a Menu Item action selects the menu via the accessibility API. So there may not even be a real “current event” at that point to process, since the accessibility API is not part of the event queue. If so, then Finale’s behaviour has accessibility implications which they may want to think about.
Thank you for such a quick, thorough and thoughtful reply!
Had already tried the first option and the other two sadly also don't work. I'll keep pondering, but if you can't think of a fourth solution then I doubt anybody can!
I revisited this issue (urged by the veteran Finale scripter) and your 3rd option WORKS! Turns out that Finale needs a MOUSE-UP WITH MODIFIER event, at least to pass modifier key information through to the plug-in (via PDK) with a menu. Several methods work to get to the required sub-menu item, but there must be a click on that sub-menu followed by a RELEASE with modifier.
This will be valuable information to a small band of dedicated Finale users who use KM for all their GUI needs. I've attached a pic of the macro and the macro itself - customised for one of my tasks.
Program a shortcut to the menu item you're targeting using:
System Preferences > Keyboard > Shortcuts > App Shortcuts
Choose a Key Combination that you're unlikely to use for anything else
and BE SURE IT INCLUDES THE OPTION KEY(or whatever modifier you need)
By including the Modifier key in the Key Combination,
Finale will be tricked into thinking the Modifier is down when the menu item is selected.
This new System Preference shortcut can now be called by KM with a Type a Keystroke action.
The downside is you lose a Hotkey for each of these you program,
and the way RGP is trending the number of modifier/scripts will increase in the near future.
Hey @MikeMcC. It's ages since I've used Apple's own keyboard shortcuts instead of KM, and you're right - this works! The downside is coordinating the System shortcuts with the KM ones (I use around 500 of them on Finale) and keeping them all intelligently referenced and cooperating with Finale's own builtin shortcuts. (KM palettes are such a brilliant way to organise groups of related activities).
About a year ago I found 3 other ways to achieve the modifier menu action, and the most convenient of these within KM is the AppleScript method outlined here: https://carlvine.com/cgi-bin/index.cgi?cv=km_opt
It all lives inside KM and only requires adding the specific requisite menu name in step two. As a side note, RGP himself envisaged modifier activation linked specifically to optional modeless operation, though of the 8 or so main contributors to the FinaleLua.com repository, he's the only one to use it like that. I always use it (now) as a Repeat Last Action option to avoid an extra (redundant) menu item.