import QtQuick 2.0 import MuseScore 1.0 MuseScore { menuPath: "Plugins.addNoteUndoProblem" onRun: { if (!curScore) { console.log("No current score!"); Qt.quit(); } var cursor = curScore.newCursor(); cursor.rewind(0); cursor.track = 0; while (cursor.segment && cursor.element.type != Element.CHORD) { cursor.next(); } if (cursor.element.type == Element.CHORD) { var chord=cursor.element; var note = newElement(Element.NOTE); chord.add(note); note.pitch=69; note.tpc1=17; note.tpc2=17; } else { console.log("No note found!"); } Qt.quit() } }