goto_bar
Move the Dorico caret to a specified bar, beat, and staff, entering note input so you can add notes or rests at that exact position.
Instructions
Move the caret to a bar and return the assumed position.
The position is assumed, not read. Dorico exposes no caret coordinates over the
Remote API, so this dead-reckons: it enters note input, rewinds to bar 1 of the
top staff, then steps forward to the bar, staff and beat asked for.
Returns:
Result dictionary with the assumed caret position and the caveat attached.
Note:
Because it counts rather than measures, the answer drifts from the truth if
anything moved the caret in between, and it cannot detect that. Treat it as
the position it aimed for, and confirm what was written with read_selection
or by inspecting the score.
This enters note input, so it is the call to make before add_notes or
add_rest. To scroll the view without touching the caret, use navigate.
Ask whether the flow opens with a pickup bar before relying on a bar
number, because Dorico leaves a pickup out of the count and this lands one
bar short without the pickup flag. The API cannot tell, so the person with
the score on screen has to say, or read an exported MusicXML with
read_score.
The move costs the same handful of commands at any flow length, so a long
flow is no less exact than a short one.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bar | Yes | Bar number, counted from 1, so bar 1 is the first bar of the flow. Not an index. | |
| beat | No | Beat within the bar, counted from 1, so 1.0 is the downbeat and 2.5 is halfway through the second beat. | |
| staff | No | Staff index, counted from 0, where 0 is the topmost staff in the current layout. Counted differently from a bar number on purpose: bars start at 1, staves at 0. | |
| pickup | No | True when the flow starts with a pickup (upbeat) bar. Dorico does not number it as bar 1, so bar navigation lands one bar short without this. Nothing in the API reveals a pickup, so ask the person whose score it is, or read an exported MusicXML file with read_score. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||