1.2 Plugin Additions
This is my understanding of the additions as mentioned in the 1.2 release notes.
curScore.close();
Closes the score.
curScore.version;
Contains the version number of MuseScore which last saved and closed the file eg 906, 10100, 10200.
This is NOT the version of MuseScore currently in use!
curScore.fileVersin;
This always contains 114 so presumably it is related to the current version in use.
Not sure how to detect if there is no current score. After curScore.close() some score properties are still there (eg staves) and others, if accessed, cause MuseScore to stop working (eg measures)
Everyone, comments please.
Comments
http://musescore.org/en/plugin-development/score-object eplains those properties and methods
http://musescore.org/en/plugin-development/global-variables explains how to check for curScore
In reply to http://musescore.org/en/plugi by Jojo-Schmitz
Score Object
n = curScore.parts();
Gives: TypeError: result of expression 'curScore.parts'[4] is not a function.
n = curScore.parts;
Works.
The same applies to measures, pages and keysig.
Are these properties not methods?
Global Variables
curScore.close();
if (typeof curScore === 'undefined') {return;}
Always drops through as the type is still object.
Also the only way I can find to create a file without a score is to remove all the instruements
but Im not sure if this is technically without a score as the type is still object.
If I use close() I can not save the result as Save etc are grayed out.
Under what circumstances can a file be created or left without a score?
In reply to Documentation by johnhenry
Score Object: Perfectly right, documentation amended...
Global Variables: which version of MuseScore are you using? in 1.2+ this works.
And of course after close() you can't save() anymore.
In reply to Score Object: Perfectly by Jojo-Schmitz
Im using version 1.2 revision 5470 downloaded 13th March.
(Cant redownload as Im abroad at he moment with only a Kindle 3G to get online.)