Issues with batch conversion / export
Hi,
I'm using Musescore 3.6.2 on Windows 10 and I've installed the Batch Convert Plugin in order to automize the conversion of hundreds of .mscz files into .musicxml and .png files. The plugin seems to be installed properly since the conversion is working.
However I encounter two problems with the plugin:
1) Corrupted files bring up a window with the message that the current file is corrupted and you have to choose either to ignore or to abort the file. This arises when the plugin tries to open the .mscz file via .readScore().
2) For several files (not all) a window pops up where Musescore wants you to save changes. This occurs when the plugin tries closing the opened .mscz file again via calling .closeScore().
I cannot figure out for which .mscz files this happens and for which not. The only thing I could figure out is that the function call .readScore() already seems to decide whether there need to be changes saved or not. Also if nothing in the score was changed.
I also took a look into the Documentation for Musescore 3, but also changing the bool parameter 'noninteractive' of .readScore() does not change anything.
As far as I understood a similar problem already occured in Musescore 2 (see https://musescore.org/en/node/55616#comment-257376) but now in Musescore 3 there seems to be the same problem.
Is there any way to workaround these two issues? Permanently windows popping up some kind of destroy the functionality of a batch conversion, especially when it comes to several hundreds of files.
Is there maybe a way such that the plugin is able to save changes in the current score or any other way to workaround the two issues?
(I've downloaded the plugin for Musescore 3.x from https://musescore.org/de/project/batch-convert)
Best wishes
Comments
Here's what that
noninteractive
is supposed to do:So setting it to
true
should have an effect on your 2nd issue, and is why the plugin does exactly that:A score gets marked as being modified (and as such in need to gatting saved) if it gets imported from a previous major version, in the case of MuseScore 3.6 also of the score is from an older 3.x version.
Are you saing it doesn't work? Maybe it is an issue with pre-3.6 score in MMuseScire 3.6, maybe the migration there is working differently from like importing 2.x or 1.x scores?
For the corruption issue that won't help and I don't think there's a possible cure.
In reply to Here's what thast … by Jojo-Schmitz
Thank you for the quick answer.
This is probably the reason for some scores being marked as modified by my Musescore version. However setting the parameter to 'true' does not change anything. They are still marked as modified and the 'save changes window' pops up.
Since I'm new to Musescore I do not know whether or how it's possible to migrate older file versions to the current one. Is that somehow possible? Maybe even such that I could automize that via code since I have to do that for hundreds of files.
Or does a function exist that simply can save the current score? That could be easily added to the .qml file of the Batch Convert plugin and would then also avoid the problem.
In reply to Thank you for the quick… by finesse129
Plugins can save scores meanwhile, but that should not get done in that plugin.
In reply to Plugins can save scores… by Jojo-Schmitz
And how can that be done in an automized way? In the documentation I could not find any command/function that can save a score.
In reply to And how can that be done in… by finesse129
As per #56216: Can't save a score from within a plugin with
saveAs()
Edit: no, with
writeScore()
(which does usesaveAs()
.In reply to As per #56216: Can't save a… by Jojo-Schmitz
I added
writeScore()
(see line 536 in the screenshot) which should overwritethisScore
which is opened in line 528 viareadScore()
. I also added anotherwriteScore()
right before thecloseScore()
(line 578) just to make sure thatthisScore
is overwritten and saved.However, when the programm reaches
closeScore()
(line 579), I still get the 'save changes pop up window'. So this does not seem to save the scorethisScore
(and thus save my problem) or did I do something wrong in the implementation ofwriteScore()
?