Can I append plugin output to an existing file?
In the ObjectExplorer plugin I see a mechanism to send output to a NotePad file via:
var rc = outfile.write(output);
if (rc){
console.log("Log file has been written to "+outfile.source);
proc.start("notepad "+outfile.source); // Windows
} else {
console.log("Something went wrong. File cannot be written");
}
Is there a way to append output to an existing outfile?
var rc = outfile.append(output); is not recognized.
Why? I wrote a plugin to record notes and chord symbols from lead sheets, and it would be handy if I could concatenate the results (the album feature again...)
Comments
See https://musescore.github.io/MuseScore_PluginAPI_Docs/plugins/html/class… for the available methods.
A solution for you would be to first perform a read in to local variable, append to that variable and then write that out again; which will truncate the old file and write the new appended content into it.
And in case you weren't aware yet; albums are revived for MuseScore 4.
In reply to See https://musescore.github… by jeetee
Thanks! Ill try that.