Need your wisdom dear Linux and mac fellows

• Apr 27, 2023 - 14:04

edit: iOS too
A tiny script to open current score folder

import MuseScore 3.0
import QtQuick 2.9
MuseScore {
  menuPath: "Plugins.Open containing folder"
  QProcess { id: proc }
  onRun:{ 
    var c
    switch (Qt.platform.os) {
    case "windows":
        c = 'explorer "'+curScore.path.match(/^(.*\/).*?$/)[1].replace(/\//g,'\\')+'"';
        break;
    default:
        c = ' ' // need your help
    }
    proc.start(c)
  }
}

Comments

On Linux xdg-open should do the right thing. On Mac just the open command should do the same. And, of course, there is no need to replace slashes in the path on both these systems.

So the answer would be something like

case "linux":
    c = 'xdg-open "'+curScore.path.match(/^(.*\/).*?$/)[1]+'"';
    break;
case "osx":
    c = 'open "'+curScore.path.match(/^(.*\/).*?$/)[1]+'"';
    break;

(tested only on Linux)

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