Issue updating Engraving Options in Lua related to OpenScoreID (I think...)

Teetering perilously on the divide between saving time in automation, and spending more time automating than fixing by hand… I’m attempting to make a couple of changes to items in Engraving Options using Lua. As a specific example, I’d like to be able to use this command:

Engrave.SetEngravingOptions?Dictionary=list: {string: "lyricOptions.distanceBetweenLyricLines"}\, {string: "5/8"}&OpenScoreID=0

Right at the end is “OpenScoreID,” which increments for each file opened—I presume—related to the fact that the engraving options window is specific to one file, and multiple can be open at once.

So my question—is there a special variable/constant that can be used as the value for OpenScoreID to indicate the “current” or “active” file?

I guess I could just repeat the script step 100+ times trying to cover every possible ID that would come up during a work session, but that seems like a less than elegant “solution.”


I’m afraid not, no. There’s no access to this kind of information about the current project via the Lua API at the moment.

It’s possible that it is included when using the WebSockets-based remote control API new in Dorico 4, but I’ll need to check.

Thanks for checking on this—much appreciated.