add_rest
Insert a single rest at the caret with the specified duration and automatically exit note-input mode. Solves placing one rest cleanly without lingering input state.
Instructions
Input one rest at the caret, then leave note-input mode cleanly.
One rest at the current caret position, which then advances by that duration.
Note input is always exited afterwards, including when the call fails.
Returns:
Result dictionary with success, the duration entered, the undo flag and the
resulting mode.
Note:
Success means Dorico accepted the command (kOK), not that the rest is where
it was wanted (docs/protocol.md, 'Command Acceptance vs Effect'). Check with
get_status or by inspecting the score.
For a passage rather than one rest, put rest events in a ScoreSpec and use
write_score: repeated calls here do not chain, because each one re-enters
note input at the caret. Use goto_bar first to choose where it lands.
Do not read can_undo as evidence: entering note input alone already sets it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| duration | No | Rhythmic duration, one of: whole, half, quarter, eighth, sixteenth, 32nd, 64th. Case-insensitive. | quarter |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||