Accessing MeasureNumber element by plugin?

• Jan 22, 2022 - 11:46

Is it possible to programmatically access arbitrary MeasureNumber elements within a score? (the elements you select when you click the measure numbers on the page – so you could adjust the visibility, offset, etc. of each)

I don't seem to get these when I iterate over Measure::elements, Segment::annotations, Segment::elementAt, etc. or with Cursor.

Currently, I have the user manually select a measure number before running the plugin, then execute cmd("select-similar") and iterate over the current selection – but this seems unideal.

If this isn't possible, I might be willing to write a PR to add it to the plugin API, if anyone could point me in the right direction in the source code!


Comments

In reply to by jeetee

I thought as much. I'm thinking it would be helpful to expose these elements through the API. They (courtesy key signatures, measure numbers, etc.) do appear in the Debugger as child elements of each Measure.

It seems inconsistent that you can access these elements through the API if they are manually selected, but not otherwise.

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