Can't find the Lua command to "Apply"

This script is made using the “Record Macro” and is supposed to copy the flow info over to Project info, however when running this it just open the “Project Info” and doesn’t do anything.
If someone knows how to write this in Lua I would be most grateful

local app=DoApp.DoApp()
app:doCommand([[File.ScoreInfo]])
app:doCommand([[Project.SetScoreInfoInternal?BlobID=11&OpenScoreID=7]])

Regards Ulrik

I don’t think that actions in a dialog can be scripted. You can open the dialog, but you can’t “press buttons” or set controls and values.

3 Likes

Ok I see, that’s a pity.

Is there any other way to get the Flow info and copy it over to the Project info via scripting?

Pressing buttons seems pretty basic for scripting. Even Finale’s first iteration of that offered that ability. I haven’t tried it, but there are keyboard options for accessing buttons, and those should work, no?

UPDATE: I can confirm scripting does NOT capture even keystrokes in a dialog (at least in the Info Dialog), making scripting all but useless for a huge number of tasks. That’s assuming I’m creating a script correctly. Someone with more experience in this area can test this. HOWEVER, you CAN maneuver and select anything in a dialog using only keystrokes.

1 Like

Not by (Dorico) scripting, but within the Project Info dialog you can use the “Copy info from” section at the bottom – select the Project in the left-hand column, and then copy info from Flow 1.

3 Likes

Hi!
Yes I know I can copy the info by hand but not via lua scripting.

I have a bunch of music xml files and I have made a script to batch open them, resetting some layout stuff and then saving them.

That works great, however when opening those xml’s the name of the piece is always set in to the Flow Info inside Dorico, but I want them to be set in the Project Info, that’s why I’m looking for a way to change it via scripting.

1 Like

In situations such as this I tend to work with external scripting / automation tools.

I seriously cannot recommend Keyboard Maestro for Mac enough, the tool very impressive and will make it possible to automate almost everything - even cross application macros (which might make sense for your multi-file processing). It has saved me many hours of work. Sadly I am not using a Mac for my primary work anymore.

If you’re on Windows, AutoHotkey seems to be the way to go - haven’t tried it yet, though.

4 Likes

Thank you for the suggestion, I am on Mac and I will check it out

Yeah, Keyboard Maestro is a dream.

Here a macro which makes exactly what you need (trigger with a custom shortcut called “hot key” in KM):

  • opens the Project Info
  • clicks on Project panel
  • clicks on the Copy (from flow 1)
  • clicks on Apply
  • clicks Close

Usage example:

3 Likes