[API]Creation of folders with the PluginAPI.writeScore method
When attempting to write a score located on a folder that doesn't exist with PluginAPI.writeScore
, an error is raised.
The request is about having this method creating all the necessary folders instead of failing.
var target="path/to/somewhere/idontexist/myscore.pdf"
if (!writeScore(curScore, target, "pdf") // --> return false, and the file "myscore.pdf" does not exist
console.log("Could not write " + target);
}
This request comes after the discussion Creating folders from a plugin.
It appears that there is no ways in QML/javascript to create folders (see this question on Stack Overflow).
The current workaround is non platform-agnostic solution that should therefore avoide.
The recommended approach is to delegate these tasks to backend objects.
PluginAPI.writeScore
is good candidate for this.
Comments
Batch Convert needs it too
As does ABC Import, although there @jeetee found a workaround
See https://github.com/musescore/MuseScore/issues/13593, so I guess we can close this here as a duplicate
Not exactly the same issue. However one can merge both.
Well, it is about
readScore
but also aboutwriteScore
andcloseScore
The issue you are mentioning is a bug of those methods within MS4. This one is feature request. Not a bug. The request is to have
writeScore
creating the intermediate folders if they don't exist. IMO, not the same, but related.I see