BUG curScore.path;

• Mar 5, 2021 - 04:38

var p = curScore.path; will not return the path if you just create and saved the score . you need to
Create
Save
Close
Open again
then it work


Comments

It it isn't saved, there is no path, not a bug there.
But if you need to close and reopen to see path, there is a bug, I guess, a plain Save shouzld be sufficient ti get that property filled/updated

In reply to by Jojo-Schmitz

hm but the behaviour of needing to reopen, after the first save, a score still there.

consider this Plugin :

Mac:

import QtQuick 2.0
import MuseScore 3.0
MuseScore {
      menuPath: "Plugins.MIDI Exporter"
      description: "Description goes here"
      version: "1.1"
      onRun: {
            var s = curScore 
            var p = curScore.path;
            p = p.slice(0, -5);
            writeScore(s, p, 'mid')
            }
      }

Win :

import QtQuick 2.0
import MuseScore 3.0
MuseScore {
      menuPath: "Plugins.MIDI Exporter"
      description: "Description goes here"
      version: "1.1"
      onRun: {
            var s = curScore 
            var p = curScore.path;
            p = p.slice(0, -5);
            p = p.replace(/\//gi,"\\")
            writeScore(s, p, 'mid')
            }
      }

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