Scripting Api
My apologies if this has been asked or requested before -
Is there a general scripting api available for Musescore?
I have a larger number of music sheets around and want to process them from the command line. For example,
o re-generate PDF for all changed sheets
o set version
o apply different template
o ...
It's extremly cumbersome to process them manually with the GUI.
Greetings, Wolfgang
Comments
Do you know about the plugin api? Not quite the same as scripting, and the set of facilities and objects exposed is highly selective (and programming it is a black art).
In reply to Do you know about the plugin… by [DELETED] 1831606
No, I haven't been aware of the plugin API as such. But since plugins exist such an API must be available :-)
The plugin API you are refering to - is that QML?
Anyway, I really miss a scripting API that would allow me to do repetive tasks from the command line.
In reply to No, I haven't been aware of… by whaefelinger
Oh , horror --- don't say the name -- yes, men and women call it ...... QML ..... heaven help those who meet its ferocious teeth (well, I guess that would be (M.) Python, not Javascript :) Yes, you can do a lot to the contents of scores with it, but UI/command things not so much ....
In reply to Oh , horror --- don't say… by [DELETED] 1831606
To give away the vicious rabbit's secret, QML is a use of Javascript by the portable Qt GUI/App framework in which MS is implemented, to provide access not to just Qt's facilities, but the application's (MS's) interfaces and structures such as made available by it to Qt, so "MS QML" is a superset/instantiation of "QML" which a superset/instantiation of Javascript (don't ask what version thereof, please).
There is no way to apply a template to an existing score. What are you trying to do in that case, perhaps there is a way to do what you are trying to do.
As for converting scores to PDF, the is a batch mode that allows you to convert all of your scores to PDF, but I've never used it. Perhaps someone familiar with it will reply.
In reply to There is no way to apply a… by mike320
https://musescore.org/en/handbook/3/command-line-options explains it.
In reply to There is no way to apply a… by mike320
But applying a style sheet should work
In reply to But applying a style sheet… by Jojo-Schmitz
Where is that described?
In reply to Where is that described? by [DELETED] 1831606
In that very handbook page, -S option
In reply to In that very handbook page, … by Jojo-Schmitz
I'm trying to learn what "style sheet" or "style" is. The obvious searches haven't been helpful ...
In reply to I'm trying to learn what … by [DELETED] 1831606
You can save and load style files, .mss files, that should be documented. And with -S you can load and app them via command line
In reply to I'm trying to learn what … by [DELETED] 1831606
Format / Save Style saves all your style & page setting to an MSS file you can then load into another score. It's basically like applying a template in most respects it doesn't actually add and remove staves to conform to the template (eg, it wouldn't turn an orchestra score into brass quintet).
In reply to Format / Save Style saves… by Marc Sabatella
Thank you!
In reply to There is no way to apply a… by mike320
There is also a QML-plugin for converting. It did not produce any result so far.
However, convert to PDF is just a scripting example. It's such a common task that it made it's way into the commandline. Better than nothing, thanks for pointing it out.