Reopen the application programatically without option to restore previous session

• Apr 29, 2018 - 14:00

Is there a way to reopen the program after modifying an xml file of the currently open score?

After modifying a music xml file, I want to programatically reopen the program with the modified changes. Is there a way to do so using the command line options of Musescore?

At the moment what I tried to do is kill the process if it is open with the path of the modified file and reopen it with that file using the command line options.

However, when the program starts it allows me to choose whether I want to restore the previous session. Is there to reopen the program in a cleaner way without getting a message regarding restoring the previous session?


Comments

In reply to by jeetee

Thank you, I did try this as well, but it results in a pop up message, saying:
'Save changes to the score "xyz" before closing'

so in this case I also have to click Discard, instead of it reopening automatically without any interaction.

Any other way?

In reply to by jeetee

I have an external program making changes in the xml file directly. When saving the XML file after editing, I want to automatically see the changes in the MuseScore program without having to manually close it and reopen it.

At the moment I have that happening, except for the fact that I have to go through that pop up message. The file is actually saved through the editor (notepad++) after I edit it, so I hoped it wouldn't make me save it inside the program as well when sending it a signal to quit.

If I understand correctly, you are trying to get an external program to communicate with MuseScore, with a goal of getting MuseScore to close a currently-open score and then reopen it? And you are currently trying to get this to happen by killing the MuseScore process then restarting it via the command line?

I wouldn't be doing that. I would instead try to send MuseScore the actual commands you want via OSC. It looks there are commands for "/close-all" and "/open", which should do the job without the need to kill the process or restart it.

In reply to by Marc Sabatella

You got it completely right. I want that whenever I save a music XML file in an editor outside of MuseScore, I would automatically see the effects inside the program, like "refresh" it. I can't find anything regarding the "/close-all" or "/open" command. Is there any documentation or a link you could provide?

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