What is NSPasteboard?
NSPasteboard is an object in AppKit that transfers data to and from the pasteboard server. The pasteboard is what most people call the clipboard. The general pasteboard is the one that copy and paste use.
Why it matters
macOS does not send an event when something is copied. An app that wants to know has to ask. The pasteboard keeps a changeCount integer that goes up each time its contents change, so a clipboard manager can read that number often and only fetch the contents when it has changed.
How NotchStar uses it
NotchStar polls NSPasteboard.changeCount every 0.5 seconds on a utility queue. When the number changes, it reads the item. Before saving it, it checks the item’s types: if the concealed pasteboard type is present, it skips it. Spreadsheets put both text and images on the pasteboard, so the code has to choose which to keep. The history holds up to 50 items in memory and clears on quit.
Types
An item on the pasteboard can offer several representations at once, such as plain text, rich text and an image. Each is identified by a type. A reader picks the one it wants.
Related
For the user view, read clipboard history and the Clipboard tool. The wider framework is AppKit.