Run IDE Script
run_ide_scriptExecutes custom Xojo IDE scripts for advanced IDE automation when dedicated tools do not fit, returning Print output or a ran-status when nothing is printed.
Instructions
Executes an arbitrary Xojo IDE script. Use Print to return a value, once: with several Prints the first that says something is returned, and an error outranks output. A script that prints nothing reports that it ran. Do not leave the script early with Return: xmcp appends a final line that tells it the script finished, and a script that never reaches it is waited on until the timeout. Powerful escape hatch — IDE scripting can quit Xojo, close/reopen projects, create or delete items, write files, and invoke shell commands via DoShellCommand. Prefer a dedicated tool when one fits (list_project_items, get_code, build_project, etc.); use this only when nothing else does, and pause before running anything that quits the IDE or touches the shell. It cannot delete project items: IDE scripting has no command for that (see create_project_item). A runtime error comes back with no message or line number. Needs the Xojo IDE running.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes | IDE script code (XojoScript syntax). Use Print for output. | |
| timeout | No | Milliseconds to wait for the answer. Default 10000. A script that runs longer is not stopped: xmcp keeps the connection open and refuses other requests until it answers, so set this high enough up front. |