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.