Adding tempo - Very specific issue related to LUA plugins

tl;dr: can’t script tempo

I know scripting is just a draft, but I’ve encountered an issue that only exists with Tempo.

After adding a Tempo marking, the just added element is selected, but not really, meaning that it is shown in blue, not in orange. The lower panel shows all the correct properties, however you can’t record any of the changes via script, because there’s something not quite right with the selection, I think. The commands are recorded, but Dorico doesn’t know what to apply them to.

When I add any other element, this problem doesn’t exist and I can record any change in the lower panel.

Update: I have tried everything, there is literally no way to successfully select a tempo marking just after you’ve added it, using scripts. It’s a pity because all the parameter changes would otherwise work, in fact they do if I select the tempo marking beforehand, which is however not what I need to do.

If there is a previous tempo marking, typing left-arrow and right-arrow will select the previous one and then the new one again, in orange.

I did notice that, thanks, but IF there is another one, and it even needs to be of the same type, e.g. Riten. doesn’t switch to Allegro. So, not the best workaround.

It seems that switching from Write to Engrave to Write properly orange-selects the tempo marking.

1 Like

Pure magic! Thank you!

app:doCommand([[Window.SwitchMode?WindowMode=kEngraveMode]])
app:doCommand([[Window.SwitchMode?WindowMode=kWriteMode]])