# (lispkit system pasteboard)

Library `(lispkit system pasteboard)` provides a simple API for interfacing with the system pasteboard. The type of content copied to the pasteboard or pasted from it is described with lists of [*uniform type identifiers*](https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html#//apple_ref/doc/uid/TP40009259-SW1).

**(pasteboard-change-count)**     <img src="/files/STqjiJsrexexyFklGQwH" alt="" data-size="line">

Returns a change count number. Changes to this number reflect state changes to the system pasteboard.

**(pasteboard-empty?)**     <img src="/files/STqjiJsrexexyFklGQwH" alt="" data-size="line">

Returns `#t` if the system pasteboard is empty; `#f` otherwise.

**(pasteboard-contains?&#x20;*****type*****)**     <img src="/files/STqjiJsrexexyFklGQwH" alt="" data-size="line">

Returns `#t` if the pasteboard contains an entry and this entry is of the given *type*. *type* is either a string or a list of strings. Each string is a uniform type identifier (UTI) such as `public.data`, `public.plain-text`, `public.utf8-plain-text`, `public.rtf`, `public.html`, `public.url`, `public.file-url`, `public.image`, `public.png`, `public.jpeg`, etc.

**(pasteboard-types)**     <img src="/files/STqjiJsrexexyFklGQwH" alt="" data-size="line">

Returns a list of strings describing the type of content available in the system pasteboard. Each type is a string containing a uniform type identifier (UTI) such as `public.data`, `public.plain-text`, `public.utf8-plain-text`, `public.rtf`, `public.html`, `public.url`, `public.file-url`, `public.image`, `public.png`, `public.jpeg`, etc. An empty list is returned when the pasteboard is empty.

**(pasteboard-ref)**     <img src="/files/STqjiJsrexexyFklGQwH" alt="" data-size="line">

Returns a value representing the content in the pasteboard. `#f` is returned if the pasteboard is empty. Values of the following data types are being returned: images, colors, styled text, strings, and bytevectors.

**(pasteboard-ref-string)**     <img src="/files/STqjiJsrexexyFklGQwH" alt="" data-size="line">\
\&#xNAN;**(pasteboard-ref-string&#x20;*****type*****)**

Returns a string representation of the content in the pasteboard for the given *type*. `#f` is returned if the pasteboard is empty. *type* is a uniform type identifier (UTI) such as `public.data`, `public.plain-text`, `public.utf8-plain-text`, `public.rtf`, `public.html`, `public.url`, `public.file-url`, `public.image`, `public.png`, `public.jpeg`, etc. If *type* is not provided, `public.plain-text` is used as a default.

**(pasteboard-ref-data)**     <img src="/files/STqjiJsrexexyFklGQwH" alt="" data-size="line">\
\&#xNAN;**(pasteboard-ref-data&#x20;*****type*****)**

Returns a string representation of the content in the pasteboard for the given *type*. `#f` is returned if the pasteboard is empty. *type* is a uniform type identifier (UTI) such as `public.data`, `public.plain-text`, `public.utf8-plain-text`, `public.rtf`, `public.html`, `public.url`, `public.file-url`, `public.image`, `public.png`, `public.jpeg`, etc. If *type* is not provided, `public.plain-text` is used as a default.

**(pasteboard-set!&#x20;*****expr*****)**     <img src="/files/STqjiJsrexexyFklGQwH" alt="" data-size="line">\
\&#xNAN;**(pasteboard-set!&#x20;*****expr type*****)**\
\&#xNAN;**(pasteboard-set!&#x20;*****expr type local*****)**\
\&#xNAN;**(pasteboard-set!&#x20;*****expr type local expiry*****)**

Copies *expr* into the pasteboard, delaring it to be of the given *type*. *type* is a uniform type identifier (UTI) such as `public.data`, `public.plain-text`, `public.utf8-plain-text`, `public.rtf`, `public.html`, `public.url`, `public.file-url`, `public.image`, `public.png`, `public.jpeg`, etc. *local* is a boolean, indicating whether to keep the pasteboard content local to the device or allow it to be published to other devices. *expiry* is a date at which the pasteboard is automatically cleared. It is `#f` by default and only supported on iOS.

**(pasteboard-clear!)**     <img src="/files/STqjiJsrexexyFklGQwH" alt="" data-size="line">

Returns a value representing the content in the pasteboard. `#f` is returned if the pasteboard is empty. Values of the following data types are being returned: images, colors, styled text, strings, and bytevectors.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.lisppad.app/libraries/lispkit/lispkit-system-pasteboard.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
