MuseScore PluginAPI - using Element.clone() on a Measure creates an unselectable empty space

• Jul 9, 2020 - 17:23
  function minionmaxAnnoying() {
        if(!curScore) return;
 
        var cursor = curScore.newCursor();
        cursor.rewind(1);
 
        var newElem = [];
 
        //STR+Z Begin
        curScore.startCmd();
 
        newElem.push(cursor.measure.clone());
 
        cursor.rewind(2);
        cursor.add(newElem[0]);
 
        //STR+Z END
        curScore.endCmd();
    }

This creates an unselectable, empty space that can only be removed by using Edit>Undo
I'm not sure how to use Element.clone() or if this use is allowed.

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