Share your AHK macros

This is really very useful. I have used when designing shortcuts for the numpad, like for instance:

;Dynamics: Hold down enter and numpad number
NumpadEnter & Numpad7::send +dp {Enter} ;p
NumpadEnter & Numpad4::send +df {Enter} ;f
NumpadEnter & Numpad8::send +dmp {Enter} ;mp
NumpadEnter & Numpad9::send +dpp {Enter} ;pp
NumpadEnter & Numpad5::send +dmf {Enter} ;mf
NumpadEnter & Numpad6::send +dff {Enter} ;ff

(…I guess you can see where I came from…)

Another powerful function is Hotstring, normally used for things like expanding abbreviations etc.

::btw::by the way

where btw will be erased and replaced by “by the way” when you press space after typing btw.

However, if you use * and b0, AHK will not wait for you to press space and will not backspace the letters you typed:

:*b0:öf::
send +df {enter}

So here I will press “ö” (an unused key on my keyboard) followed by “f” to trigger the script. The popover opens and a forte marking is entered. With this method you can further extend the range of possible shortcut combinations.

Proceed with caution though, because Dorico seems to be a bit picky with sharing its programmed shortcut keys with the script engine… for instance I could not do :*b0:öp:: to assign “p” to creating a piano, because playback would start no matter what I tried. Somone who knows AHK could probably solve that. I can’t.

Dorico does not know ahk is in use, interprets what ahk types as simple user input, i.e., as if the user is actually typing,

LAE, you basically need to calculate how long Dorico needs to open the pop up, and then build that into your code (as “sleep” IIRC). If AHK types “p” before the popup opens then yes, it’ll just initiate playback.

Well, in this case with using “ö p” as a trigger keys, I can’t use any sleep commands between key presses. The actual script is not launched yet. It is me typing the p…

Thanks Steve, that is obviously the reason.