Replace Selected Text
set_selected_textReplaces the selected text in the Xojo IDE code editor or inserts new text at the cursor, optionally selecting a specific range first.
Instructions
Replaces the selection in the Xojo IDE's code editor with text, or inserts it at the cursor when nothing is selected. Pass selection_start to select a range first; otherwise it acts on whatever the user or an earlier call left selected. Fails if no code editor is active. For a change you can describe by its content, edit_code is more reliable because it does not depend on offsets. The change stays in the IDE until save_project. Needs the Xojo IDE running with the project open.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text to put in place of the selection | |
| selection_start | No | Character offset, from the start of the item's code, to select from before replacing. Omit (or -1) to use the current selection. | |
| selection_length | No | Characters to select from selection_start. Default 0, which inserts without replacing anything. Ignored without selection_start. |