How to detect that Dorico is running from AHK?

I ran Finale with AHK macros (invoked from either StreamDeck or numeric keypad ). My macros live in a block surrounded by

#IfWinActive Finale
**; all the finale-specific macros **
#If

As now I must run Finale and Dorico simultaneously for a few years I’d like the same ‘protection’ for my Dorico macros.

I’ve tried :

#IfWinActive Dorico
**; all the Dorico-specific macros **
#If

but AHK does not seem to recognise the ‘Dorico’ class on windows. Does anyone know how I can ensure my macros only execute when Dorico is active.

I looked into this when I moved to Dorico as well. It appears that the Qt framework that Dorico uses does not follow the “usual” rules of Windows apps, so AHK is not able to see its windows and classes.

You can find AHK forum topics and other pages that discuss addons that help interact with Qt-based applications. I didn’t really go further than that, because it turned out that Dorico’s native customization gave me almost everything I wanted.

RE: Qt framework

Sigh - it shouldn’t surprise me, so nothing is ever perfect, even Dorico. :grinning:
I will just have to have a second AHK file with ‘unconditional’ macros and load that before I work in Dorico. I guess QT also means I have to load my Dorico-specific subdirectory/page by hand.

I’ve used many complex macro systems all my working and composing life.

What’s so very beautiful about AHK is that the macros are defined in a text file and hence self-documenting. Superficially it feels slick to record macros directly. But over the years when you come back to modify them so often you can’t work out what they’re doing :frowning_face:. (For years I had a Cherry or Logitech macro keyboards with practise and in desperation one could just about read Logitech data xml files !)

My work stream is three level

  1. Numpad keypad and StreamDeck as inputs
  2. Documented macro logic in AHK
  3. Only the most required macros in 'the ap ’ (in this case Dorico or Finale).

Most frequent commands go on the Numpad keypad. My bird brain remembers around 16 different buttons with no key caps. The next 31 less-used commands go on the root folder/screen of the StreamDeck.

i’m aware that there are commercial StreamDeck libraries available that I could use. But because I write guitar music i’ve always found my needs are relatively unique. I’d rather be defining my own stuff from scratch than trying to sort out other code which I may or may not understand.