Adding a LayoutBreak to the selection returns a "Cannot select LayoutBreak"

• Apr 27, 2022 - 15:38

I've got a piece of code that isolate different elements from the cursor in order to reselect them individually.
The "re-selection" code is the following:

        curScore.selection.clear();
        for (var i = 0; i < harmonies.length; i++) {
            curScore.selection.select(harmonies[i], true);
        }
        for (var i = 0; i < infos.length; i++) {
        console.log("selecting "+infos[i].userName());
            curScore.selection.select(infos[i], true);
        }

where harmonies are elements of type Element.HARMONY and infos are elements of type Element.LAYOUT_BREAK.

Adding the Element.LAYOUT_BREAK elements throws the following warning:
Warning: Cannot select element of type LayoutBreak

Any idea why ?


Comments

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