clipboard¶
Clipboard operations read and write plain text on the operating system clipboard and place library item files onto the clipboard for pasting into a file manager or external application. All three operations require the ui permission.
clipboard.readText and clipboard.writeText target the application as a whole and do not require an open library or window. clipboard.copyFiles targets a library to resolve item IDs to on-disk paths.
clipboard.readText¶
Read the current plain-text contents of the system clipboard.
Parameters
None. Passing library or window is rejected with bad_request.
Returns
{ text: string | null } — the clipboard text, or null if the clipboard is empty, holds non-text content or cannot be accessed.
Example request
Example response
Events and errors
Publishes no events. Returns not_allowed (403) without ui, or bad_request (400) if library or window is supplied.
clipboard.writeText¶
Replace the system clipboard contents with plain text.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
text |
string |
Yes | — | Plain text to place on the clipboard. |
Returns
Done — { success: true }.
Example request
Example response
Events and errors
Publishes no events. Returns bad_request (400) if text is missing or library/window is passed, not_allowed (403) without ui or failed (422) if the operating system clipboard cannot be written.
clipboard.copyFiles¶
Place the on-disk file paths of one or more library items onto the system clipboard's file list so they can be pasted directly into a file manager or another desktop app. Items whose files are missing or on offline storage are skipped as long as at least one file in the batch exists on disk.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
ids |
(string \| number)[] |
Yes | — | Item UUIDs or internal row IDs whose files should be copied to the clipboard. |
library |
string |
No | Default library | Target library (ID, path or unique name). Not allowed for plugin callers. |
Returns
{ count: number } — number of existing files placed on the clipboard.
Example request
Example response
Events and errors
Publishes no events. Returns not_found (404) if any item ID does not exist in the library or if none of the resolved items' files can be reached on disk, not_allowed (403) without ui, library_closed / library_offline (409) if the library is unavailable or failed (422) if the OS clipboard rejects the file list.