notesy::clipboard

Copying to the system clipboard, and reading what's on it. Copying takes clipboard.write. Reading takes clipboard.read, which the approval shows in red: what the user copies can be anything, a password included. A script given only one of the two has only that function.

rustuse notesy::{clipboard, commands, log};

pub fn ready() {
    commands::add("copy-date", "Copy the date", |command| clipboard::copy("2026-09-12"));
    commands::add("measure-clipboard", "Measure the clipboard", |command| {
        if let Some(text) = clipboard::paste() {
            log::info(`${text.len()} characters on the clipboard`);
        }
    });
}
Function What it does Needs
clipboard::copy(text) Puts text on the clipboard. clipboard.write
clipboard::paste() What's on the clipboard, as text: Some(text), or None when it holds no text (an image, say). clipboard.read

notesy checks the plugin's permission again for each call.

Every page