Stream deck programming question

Hi folks. I have taken the plunge and begun using a stream deck with notation express. I’ve also created a few custom buttons corresponding to hotkey combinations.

One of the time sucks in my current workflow is moving bar numbers in Engrave mode. I show bar numbers on every bar and have Avoid Collisions turned off.

My question is: is it possible to create a button where I can select a bar number and have the button move the Bar Number Y value a certain amount?

You might need to use Keyboard Maestro (Mac) or AutoHotKey (Windows) or similar to simulate the mouse clicking a number of times in the up arrow of the Y value for the bar number position (in Engrave), Stream Deck can work with these apps and often has to for more complicated scripting.
If you are interested in investigating this, search here at the forum, as others have used the combination for automating various tasks. I found Keyboard Maestro reasonably easy to use, although it was for simple processes. (You do not even need to use Stream Deck for actions such as this unless you want to, for example you can trigger the script with a key command.)

Others might have a better solution :slight_smile:

It’s possible, but you’ll have to manually hack in a key command first. (Unless you can figure out how to do it with the Dorico API, which I haven’t.) You can get the exact command by using Script / Start Recording Macro, type in the Y value you want, then End Recording Macro. It will look something like this, but with your value:

UI.InvokePropertyChangeValue?Type=kBarNumberDy&Value=string: “3/2”

In your user keycommands_en.json file, simply manually add a shortcut for that command (probably in the kGlobal context). I’ve got a bunch of these hacked in and the syntax will look like this:

Once you have a key command assigned to the action you want, it’s simple to have the SD trigger that shortcut.

(Make sure you back up your key commands file first. I think this is one of those situations where if you get the syntax wrong then Dorico won’t start, so you’ll want to be able to undo any change.)

EDIT: Even if you put the command in the kGlobal context, I’m pretty sure it will only work in Engrave, so you you might want to have the SD put a Cmd/Ctrl+3 first to switch to Engrave in case you aren’t already in it, then a small Delay (if needed), then the custom key command. For example, here’s my configuration to trigger Erase Background for chord symbols. This usually annoys me while I’m writing, so I have my SD button set to switch to Engrave, trigger the shortcut, then switch back to Write. If you are used to making your bar number edits in Engrave that switch might be unnecessary and undesired, but just showing what’s possible: