Plugin does not work

• Jan 3, 2019 - 14:21
Reported version
3.0
Type
Functional
Frequency
Once
Severity
S4 - Minor
Reproducibility
Always
Status
active
Regression
No
Workaround
No

Does not appear to do anything. IF no doc is open, I get File "/emp/my_music.xml" not found
With a blank document open, I get no error, but nothing is imported.


Comments

Do you have an ascii tab file to import?

The error message implies that there has to be a /tmp directory, which is not the case on Windows, but is on Linux and Mac, so maybe that plugin doesn't work for Windoes?

within plugins : the "notes" does not return the list of notes. It return always a nil value.
The test above return existence of chords with test "cursor.element().type === Ms.CHORD", but "notes" is always nil.

Same issue on Linux and Mac-OSX (linux reported hereafter)
OS: Ubuntu 18.04.1 LTS, Arch.: x86_64, MuseScore version (64-bit): 3.0.0., revision: c1a5e4c
Qt version 5.9.3.

import QtQuick 2.2
import MuseScore 3.0
MuseScore {
version: "3.0"
description: qsTr("test plugins musescore 3")
menuPath: "Plugins.Notes.test"

  function listnotes() {
        var cursor = curScore.newCursor();
        cursor.rewind(1);
        var startStaff = 0;
        var endStaff = curScore.nstaves - 1;
        for (var staff = startStaff; staff <= endStaff; staff++) {
              console.log("  listnotes staff=" + staff);
              for (var voice = 0; voice < 4; voice++) {
                    console.log("    listnotes voice=" + voice);
                    cursor.rewind(1); // sets voice to 0
                    cursor.voice = voice; //voice has to be set after goTo
                    cursor.staffIdx = staff;
                    cursor.rewind(0) // beginning of score
                    while (cursor.segment()) {
                          if (cursor.element() && cursor.element().type === Ms.CHORD) {
                                console.log("      listnotes chord");
                                var notes = cursor.element().notes;
                                if ( notes ) {
                                      for (var k = 0; k < notes.length; k++) {
                                            var note = notes[k];
                                            console.log("       listnotes note=" , k );
                                      }
                                }
                                else {
                                      console.log("        listnotes zero note");
                                }
                          }
                          cursor.next();
                    }
              }
        }
  }

  onRun: {
        console.log("hello test plugins musescore 3");
        if (typeof curScore === 'undefined')
              Qt.quit();
        listnotes()
        Qt.quit();
     }

}

console output :
Debug: hello test plugins musescore 3
Debug: listnotes staff=0
Debug: listnotes voice=0
Debug: listnotes chord
Debug: listnotes zero note
Debug: listnotes chord
Debug: listnotes zero note
Debug: listnotes chord
Debug: listnotes zero note
Debug: listnotes voice=1
Debug: listnotes voice=2
Debug: listnotes voice=3