Berteh,

I haven't tested this myself with MuseScore (I don't know the plugin framework well), but you might be able to use object detection.

For example:

if (note.get("color")) {

console.log("MuseScore 3 object")

} else if (note.color) {

console.log("MuseScore 2 object")

}


If this gives errors you could enclose in a try catch statement.

The only problem would be the import statements at the beginning (since it doesn't seem to like if statements are allowed outside the "MuseScore {}" object. But maybe changing one or two lines is still manageable?

David

On 9/27/2019 4:24 AM, Joachim Schmitz wrote:

This would be nice,  but is not possible as far as I'm aware



---- B Berteh schrieb ----

Hello.

Is there a way to keep a single qml code file for both MScore 3 and 2, as the import are different ? and if yes how ? ... provided of course the plugin does not need specific elements from API v3.

Just asking since my <https://github.com/berteh/BandInMuseScore/blob/master/BandInMuseScore.qml>https://github.com/berteh/BandInMuseScore plugin is quite straightforward and I don't want to complicate maintenance with code duplicates.

have a nice day,
Berteh.



_______________________________________________
Mscore-developer mailing list
Mscore-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mscore-developer


_______________________________________________
Mscore-developer mailing list
Mscore-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mscore-developer

Reply via email to