Running QML scripts

• Apr 20, 2025 - 06:37

I'm trying to run a QML plugin in MuseScore 4.5.1 (Windows 10, 64-bit) to insert layout breaks after rests in a score. The plugin shows up in the menu and is enabled, but it has no visible effect on the score, and console.log() output does not appear, even when running MuseScore from a terminal.

I confirmed:

The plugins are in the folder shown in Preferences > General > Folders

They appear in Plugins > Plugin Manager, and I can enable them and run them from the menu

I tried multiple plugins: one that adds staff text to each segment, and one that adds a layout break after rests — none had any effect

I am importing scores via MusicXML and saving as .mscz

I experimented with QML on advice from chatGPT - and the bot wrote this topic after our tests. One other wrinkle. The computer is using OneDrive.

Thanks in advance

Attachment Size
PROVERBS-004.XML 166.48 KB
lineBreaksAfterRests.qml 856 bytes
testHello.qml 202 bytes
testVisible.qml 646 bytes

Comments

Couldn't find any way to check the logs.
imported 3.0 and removed qt. reloaded scripts and still no action on the xml or the saved mscz

Thanks for the tries. It would save me 1000s of clicks if I find a way to do this. I tried putting line breaks into my XML but they didn't load.

Attachment Size
Capture.PNG 59.68 KB
lineBreaksAfterRests.qml 845 bytes

In reply to by Bob MacDonald1

The only instance of the string "newLayoutBreak" in your code is in line 27:

> const layoutBreak = curScore.newLayoutBreak();

I don't know QML well enough to know for sure, but I suspect that "new" is the problem. It needs either to go elsewhere in the statement, to be separated in some fashion from other parts of the statement, or to be removed altogether. Purest WAG, yes! :-)

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