dialog¶
Native OS file and folder chooser dialogs let scripts, MCP tools and plugins ask the user to pick files or paths on disk. All three operations require the ui permission, bring the target Curio window forward, parent the OS dialog to that window and hold the window's single-prompt lock (busy if another prompt or dialog is already open). When invoked by a plugin page inside a secondary plugin window, the dialog is parented to that plugin window.
None of these operations read or write file contents themselves. To import chosen paths into the library or export items to a chosen folder, follow up with item.add.fromPaths or item.export (which require files.outside in addition to files.write where applicable).
dialog.openFile¶
Open the operating system's file picker dialog over a Curio window and return the chosen file path(s).
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
title |
string |
No | System default | Dialog window title. |
multiple |
boolean |
No | false |
Allow selecting multiple files at once. |
filters |
{ name: string; extensions: string[] }[] |
No | [] |
File type filters shown in the dialog. Leading . characters are stripped from extensions (for example ["png", "jpg", "webp"]). |
window |
string |
No | Most recently focused window | Target window ID from library.list. Not allowed for plugin callers. |
library |
string |
No | Default window's library | Target the window showing this library. Not allowed for plugin callers. |
Returns
{ paths: string[] | null } — array of absolute filesystem paths (length 1 when multiple is false), or null if the user canceled the dialog.
Example request
Example response
Events and errors
Publishes no events. Returns not_allowed (403) without ui (or if a plugin passes window or library), no_window (409) if no matching window is open or busy (503) if the target window already has an active prompt or dialog.
dialog.openFolder¶
Open the operating system's folder picker dialog over a Curio window and return the chosen directory path.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
title |
string |
No | System default | Dialog window title. |
window |
string |
No | Most recently focused window | Target window ID from library.list. Not allowed for plugin callers. |
library |
string |
No | Default window's library | Target the window showing this library. Not allowed for plugin callers. |
Returns
{ path: string | null } — absolute path of the chosen folder, or null if the user canceled.
Example request
Example response
Events and errors
Publishes no events. Returns not_allowed (403) without ui, no_window (409) if no matching window is open or busy (503) if the target window already has an active prompt or dialog.
dialog.saveFile¶
Open the operating system's Save As dialog over a Curio window and return the chosen destination path. Curio does not create or write the file.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
title |
string |
No | System default | Dialog window title. |
fileName |
string |
No | — | Suggested file name pre-filled in the save dialog. |
filters |
{ name: string; extensions: string[] }[] |
No | [] |
File type filters shown in the dialog. Leading . characters are stripped from extensions. |
window |
string |
No | Most recently focused window | Target window ID from library.list. Not allowed for plugin callers. |
library |
string |
No | Default window's library | Target the window showing this library. Not allowed for plugin callers. |
Returns
{ path: string | null } — absolute path chosen by the user, or null if canceled.
Example request
Example response
Events and errors
Publishes no events. Returns not_allowed (403) without ui, no_window (409) if no matching window is open or busy (503) if the target window already has an active prompt or dialog.