How do I get console.log() in a plugin to work so that I will be to see it?

• Aug 6, 2021 - 20:04

This is an embarrassing question, but how in the hell do I get console.log() in a plugin to work so that I will be to see it? I'm a beginning user at MuseScore. I've looked every where and simply can't find it. Can you help me?

As always, thank you for you time and patience.

// Am assuming QtQuick version 5.9 for Musescore 3.x plugins.
import QtQuick 2.0
import QtQuick.Controls 2.2
import QtQuick.Dialogs 1.1
import MuseScore 3.0

MuseScore {
id: oMuse
version: "1.0"
description: "Examine an Element"
menuPath: "Plugins.DEV.Examine an Element"

QtObject { // oUserMessage
    id: oUserMessage

    //  PURPOSE: Is an error recording and reporting object, used
    //to provide error and warning messages to the user.

    property bool bError: false
    property int iMessageNumber: 0 // <-- Last trapped error
    readonly property var sUserMessage: [
                //  0: <-- All OK, No Error
    "OK",
                //  1:
    "Nothing Selected - please select 1 or more elements in the score and try again.",
                //  2:
    " ",
                //  3:
    " ",
                //  4:
    "Unrecognized element. Don't know how to handle it.",
                //  5:
    "Selection appears to be invalid. Please clear your selection and try again.",
    ]

    function getError() { return bError; }

    function clearError() {
        bError = false;
        return;
    }

    function setError(iMessageNum) {
        oUserMessage.bError = true;
        oUserMessage.iMessageNumber = iMessageNum;
    } // end function setError()

    function showError(bReset) {
        console.log("", oUserMessage.sUserMessage[oUserMessage.iMessageNumber]);
        if (bReset) {
            oUserMessage.iMessageNumber = 0;
            oUserMessage.bError = false;
        }
    } // end function getError()

Comments

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