open a 4.x score with MU3.7

• Sep 21, 2024 - 14:48

I'm trying to open a MU4.x score with the API and MU3.7:

      onRun: {
            var thisScore = readScore("D:\\Misc\\temp\\HelloMU3.mscz", false);
            console.log(thisScore.title);
            var thisScore = readScore("D:\\Misc\\temp\\HelloMU4.mscz", false);
            console.log(thisScore.title);
            }
      }

And it fails.
If I set the interactive flag to true, MU popups a warning that the score is a MU4.x score. If I click on Ignore, the score is processed as accepted.

If I set the interactive flag to false, the score is not opened.

So "interactive=false" ≡ "stop opening the score if any warning".

Is this the expected behaviour ?

How could I, in non-interactive mode, force the score opening despite the warning ?


Comments

In reply to by parkingb

This is the culprit code:

      if (converterMode && canIgnore && ignoreWarnings) {
            fprintf(stderr, "%s\n\nWarning ignored, forcing score to load\n", qPrintable(msg));
            return true;
            }

ignoreWarnings gets set by -f, converterMode gets set by -o, ``canIgnore` gets checked for certain errors, file to old or to new or corrupt is setting it to true, criticall corrupted, not existent and some other to false

In reply to by Jojo-Schmitz

It is working fine. I tested from both the command-line with the -f flag:

"D:\...\MuseScore3.exe" "D:\Misc\temp\HelloMU4.mscz" -f -o "D:\Misc\temp\HelloMU4.pdf"

And from the plugin Creator:

var thisScore = readScore("D:\\Misc\\temp\\HelloMU3.mscz",true);
console.log("MU3 interactive: "+thisScore.title);
if (thisScore!==null) closeScore(thisScore);

var thisScore = readScore("D:\\Misc\\temp\\HelloMU3.mscz",false);
console.log("MU3 non-interactive: "+thisScore.title);
if (thisScore!==null) closeScore(thisScore);


var thisScore = readScore("D:\\Misc\\temp\\HelloMU4.mscz", true);
console.log("MU4 interactive: "+thisScore.title);
if (thisScore!==null) closeScore(thisScore);

var thisScore = readScore("D:\\Misc\\temp\\HelloMU4.mscz",false);
console.log("MU4 non-interactive: "+thisScore.title);
if (thisScore!==null) closeScore(thisScore);

The only observation I would make, is that a MU4 score gets automatically a status "modified" and when closed by closeScore a popup "Save the change before closing ?" is shown.

In reply to by parkingb

  1. The first variant should have worked before my change, that change (the 2nd commit) would cause
"D:\...\MuseScore3.exe" -f

not showing that dialog when opening any corrupt or wrong version scores, and not only in vonverter mode (i.e using the -o filename option.

  1. Is that gets automatically a status "modified" happening regardles of using true ot false?

In reply to by parkingb

BTW: you seem to be using true and false the wrong way round, the variable is called noninteractive, so is supposed to be true if non-interactive and false if interactive
In that true case, non-interactive, it should not prompt for saving, and now also not ask for confirmation on load.
In the false case, interactive, it should to both, ask confirmation and ask for saving

Do you still have an unanswered question? Please log in first to post your question.