cursor.isChord() is not a method, even though the handbook says it is.

• Jan 25, 2020 - 23:48

I've attached the Musescore plugin I wrote, if you run it from the plugin creator, then you'll get a message similar to this:

16:-1: TypeError: Property 'isChord' of object Ms::PluginAPI::Cursor(0x1e54d040) is not a function
Warning: :16: TypeError: Property 'isChord' of object Ms::PluginAPI::Cursor(0x1e54d040) is not a function

Thank you in advance.

Attachment Size
cursortest.qml 925 bytes

Comments

Where did you find this in the handbook? The actual Handbook page for plugins is this one with the corresponding Doxygen-generated documentation for its API located here.

As for your example, to check whether the element at cursor exists and whether it is a chord something like this should be used:

if (cursor.element && cursor.element.type == Element.CHORD) {
    // do something...
}

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