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ā€¦

Hi folks, Iā€™m returning to ask about this function. Iā€™m needing to change several engraving options for around 6,000 files: specifically, staff line thickness and stem thickness. I then need to set a location for the PDF and export it.

Even on a fast computer, these functions, along with Save and Close, will add up toā€¦ a lot of time.

Iā€™m sure thereā€™s a way to automate this, but itā€™s beyond me. Would anyone be willing to write a script for me for a cost? Or help me write one myself? Iā€™m on Windows, if that matters. Thanks!

(cross-posted to FB)

1 Like

This request sounds totally legitā€¦ Iā€™m curious, which settings are you willing to type for staff line thickness and stem thickness? For the first, Iā€™m using mostly 7/50 these days. I donā€™t think Iā€™ve changed the stem thickness but your post makes me wonder :wink:

Iā€™m doing 1/12, but I need it set to 1/16.

Thatā€™s quite thin! The default staff lines are 1/8th.

I know, but thatā€™s what I need!

I also still need to bulk-remove all leading hyphens from older scores, as well as increase the margins. Thereā€™s all sorts of stuff Iā€™d like to be able to change in bulk.

I hope you get your wish, Dan. I canā€™t imagine the time it will take just to proof everything afterwords. Wow.

The remote control API might be useful here. It depends on the specifics of the task and how the command is implemented in Dorico. If you perform the operations you need and then send me the associated actions out of the log file, it will help in determining the feasibility. Essentially, the API could ā€œplaybackā€ the commands in the log, but sometimes the granularity of info isnā€™t available. Iā€™m assuming this isnā€™t time critical.

1 Like

Thanks, Iā€™ll do that. And no, itā€™s not time-sensitive.

Kinda OT: is that API documented somewhere?

A bit, but not much. You can email Daniel about access to it. Itā€™s pretty limited at the moment, but weā€™ll see how it grows.

@dspreadbury, can I have a peek?

You can break down the task into three steps

  1. Getting a load of files, performing something to each one.
  2. The Something: Open, trigger a Dorico Script from the menu, save and close.
  3. Running a script that uses the Library Manager to sync those options to the (especially saved) user defaults.

No. 3 is the easy bit; No.2 may require a platform-specific macro utility to simulate the menu selection; No. 1 would then have to take each file, open it and trigger the macro utility, then save and close the file.

On the Mac this would be straightforward, possibly without any third-party tools. I donā€™t know whether the Windows shell could do this.