I have a number of Lua scripts that move to Engrave move, do a thing, then move back to Write mode. Usually the action is applied to the current selection, e.g. hiding stems on selected notes; applying a Break, etc.
Trouble is, if I was previously using one of the ‘other’ sub-modes of Engrave mode - Staff Spacing, Note Spacing, Frames, - then the selection is lost. so I can’t just script an action to change to Graphic Editing mode.
So, do any of the Lua scripting fiends know a command to move from Write mode to Graphic Editing all in one go, while maintaining the current selection?