Bulk change to engraving option across multiple files

Now that Dorico 4 has the long-awaited option to omit the restatement of the hyphen at the beginning of the system, I need to change this setting for several thousand files, save, and re-export to PDF (a fixed folder path).

Would someone be able to help me write a script for this?

Hmm. Unless I’m missing something, it’s not possible to ‘batch process’ files in Dorico; and while it’s easy enough to iterate through files outside of Dorico, there’s no way of asking Dorico to do something from outside, either.

You can certainly create a script that sets the option and exports the PDF (and possibly close the project?). But you’ll have to open each one…

Yes, I’m expecting that the answer comes from outside Dorico, just wondering if there’s any way to automate the process. Not the way I’d prefer to spend the next two days…

1 Like

It is possible to just record and repeat key strokes, menu commands and mouse movements with macro programs. Whether you can combine that with a file batching ‘end’ might depend on the software available.

Remind me: are you Mac or Windows?

I’m on windows 11.

I have some of these things assigned to key commands, but some of the functions are trickier. For example, I can open engraving options, but I don’t know how to navigate to the option I want without a mouse. Also, I have to click to choose the folder for the export location. And then there’s a matter of waiting for the next command… Not sure if there is a way to tell the next commands to send as soon as the program is ready…

Probably best to record a Dorico script of setting the option:

local app=DoApp.DoApp()
app:doCommand([[Engrave.Options]])
app:doCommand([[Engrave.SetEngravingOptions?Dictionary=list: {string: "lyricOptions.showLyricHyphenAtStartOfSystem"}\, {bool: false}&OpenScoreID=0]])

You can add the Print sequence, though that produces ‘quite a lot’ of code.

Then have a macro that triggers the script.

Thanks, that’s very interesting. Alex has been helping me with a script for printing, but it’s just not quite working. I’ll give this a shot further.

It didn’t work. The script opens Engraving Options, closes them again, saves the file, and closes it. But it doesn’t actually change the Engraving Option setting, and it doesn’t export the PDF.

I really would be happy to compensate someone to write this script…