[Solved] AHK script for string bowings?

I’m aware that Dorico does not yet provide the option for custom shortcuts for entering marks. Specifically, I need to quickly mark upbows and downbows. When marking a score, this is a constant series of marks made perhaps hundreds of times.

I’ve seen people mention AutoHotKey as a solution until Dorico rolls out this feature. I use AHK, but only for a couple special characters… and I copied the code from someone else. I’m not much of a coder…!

Would anyone be willing to share their AHK scripts for up and down bow marks?

Thanks!
Dan

If you go to Preferences > Edit, there is a choice called “Allow Multiple Items to be Created with the Mouse”. Check it and select the choice directly below - “Load Pointer with Item”. Go back to your score, select the downbow, and notice the mouse pointer has the downbow displaying. Click in all of your downbows one by one. To change to the upbow, press escape, click on the upbow on the palette, and away you go.

Does that work for you?

Thanks Bruce. The reason that isn’t ideal is that up and down bowings are entered one after another, often alternating, rather than in a single batch. So while this method is better than typing out the technique name in the popover, it’s still not ideal.

I think it would require a little guesswork, Dan, because in Dorico the right arrow key doesn’t reliably select the next note, and the left arrow key doesn’t reliably select the last note. That makes this kind of thing difficult in AHK.

Well, this might make it it little less painful, but not completely automated.

You can record a lua script in Dorico, from the Script menu, and then use the Script>Run Last Script menu item to repeat it over and over.

I recorded one for you that adds alternating down and up bows on each note, if you start with a single note selected, and goes on for a few iterations of that. You’ll probably have to manually intervene sometimes if the selection goes to the wrong object. I tested it in a single staff project, and didn’t run into that.

Unzip the archive and put the file in %AppData%\Steinberg\Dorico 2\Script plug-ins\ If you’re not on Windows, reply and I or someone will get you the file path.

When you want to run it, use the menu item, Script>Run Script

You can open the file with a plain text editor and have a look, it’s not too complicated. Feel free to ask questions…
down-up bows.zip (337 Bytes)

Here is some code that add creates an upbow in response to Ctrl+Shift+Alt+u and a downbow in response to Ctrl+Shift+alt+d.

It’s a bit slow and you may have to uncomment out the sleep lines to get it to work. If you select two notes on a stave, it will fill the notes in between with the same up/downbow marks, so the sticky mouse suggestion above might be a better option.


You could amend the code to repeatedly move to the next note using the right arrow ({Right}) and adding the opposite bowing mark for perhaps 10 of 20 notes. It might save a bit of time.

^+!u::
Send +p
;Sleep 2
Send upbow
;Sleep 2
Send +{Enter}
;Sleep 2
Send +{Enter}
;Sleep 2
return


^+!d::
Send +p
;Sleep 2
Send downbow
;Sleep 2
Send +{Enter}
;Sleep 2
Send +{Enter}
;Sleep 2
return

Thanks guys! Unfortunately, bowings do not strictly alternate between notes - it’s all dependent on the dynamics, phrasing, and other factors. So a script that alternates up and down every note doesn’t work.

I will try kenneth’s AHK script. Thanks!

In my opinion, what is really needed is something simple, e.g., the ability to go into a mode in which left clicking a note will place (or remove) a downbow, or right clicking will put an upbow, above it.

David

I had the same wish: inputting upbow and downbow very often and very quickly, mixed with other playing technics. Shift+P + type in »upbow« or »downbow« is far too slow for me.
My AHK script (created using Pulover’s Macro creator) works fine: Alt+F6 for upbow; Alt+F7 for downbow


; This script was created using Pulover’s Macro Creator
; www.macrocreator.com

#NoEnv
SetWorkingDir %A_ScriptDir%
CoordMode, Mouse, Window
SendMode Input
#SingleInstance Force
SetTitleMatchMode 2
#WinActivateForce
SetControlDelay 1
SetWinDelay 0
SetKeyDelay -1
SetMouseDelay -1
SetBatchLines -1

; UserGlobalVars

!F6::
Macro1:
Send, {LShift Down}
Sleep, 313
Send, {p}
Sleep, 140
Send, {LShift Up}
Sleep, 34
Send, {u}
Sleep, 34
Send, {p}
Sleep, 34
Send, {b}
Sleep, 34
Send, {o}
Sleep, 34
Send, {w}
Sleep, 34
Send, {Enter}
Send, {Enter}
Return

!F7::
Macro2:
Send, {LShift Down}
Sleep, 313
Send, {p}
Sleep, 140
Send, {LShift Up}
Sleep, 34
Send, {d}
Sleep, 34
Send, {o}
Sleep, 34
Send, {w}
Sleep, 34
Send, {n}
Sleep, 34
Send, {b}
Sleep, 34
Send, {o}
Sleep, 34
Send, {w}
Sleep, 34
Send, {Enter}
Send, {Enter}
Return


!F12::ExitApp

If the popover suggests “upbow” after typing just a few of the letters, the script could be made more efficient.

Or if the “upbow” text for the popover can be changed to something shorter in the playing techniques editor?