A simplified interface to the macOS pasteboard. Implemented by the global object, pasteboard.

interface Pasteboard {
    content: PasteboardContent;
    text: string;
}

Properties

Properties

Get and set the content of the pasteboard, of the specified types

text: string

Get and set the plain text content of the pasteboard.

This property corresponds with the pasteboard type public.utf8-plain-text.

When placing text on the pasteboard this way, PopClip's "Copied" notification will not appear. (Typically, scripts should use PopClip.copyText instead, so that the user gets the "Copied" notification.)

The value of this property will always be a string. If there is no plain text value on the pasteboard, reading this property will give an empty string ("").

Example

let x = pasteboard.text;
pasteboard.text = "new text";