Skip to main content
100%

Clipboard/Pasteboard reading

✓ Published0🌍 Public
KKevinGutowski
Last edited Sep 9, 2020
Created on Sep 9, 2020

This example demonstrates a live readout of the system clipboard’s contents by inspecting the pasteboard directly. It shows the list of available data types, then retrieves and prints the plain-text and HTML representations, as well as the raw bytes of a custom Apple WebKit type. The code uses the macOS `NSPasteboard` API and its `generalPasteboard()` method to access the current pasteboard item, calling `pasteboardItems()` and then `stringForType` and `dataForType` to extract specific formats. The output is logged to the console, revealing the actual clipboard payload.

AI-generated description

Similar vizzes