What is NSPasteboard?

Developer terms Published

All of glossary Try NotchStar in the browser Buy for $4

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.

For the user view, read clipboard history and the Clipboard tool. The wider framework is AppKit.

Keep reading.

What is the concealed pasteboard type?
The concealed pasteboard type is a marker password managers put on copied secrets so clipboard tools can skip them. Learn how it works and where it falls short.
What is AppKit?
AppKit is Apple's older framework for building Mac apps with windows, menus and events. Learn what it covers and why SwiftUI apps still use it.
What is clipboard history?
Clipboard history is a list of the things you recently copied, so you can paste an older item again. Learn how it works on a Mac and what to watch for.
Clipboard history that lives in your notch
Searchable clipboard history in the Mac notch: text, links, images and files. Skips password manager copies. Click any item to copy it again.

More in Developer terms.

What is NSPanel?
NSPanel is the AppKit window class for auxiliary windows such as palettes and utility panels. Learn why a notch app uses a non activating one.
What is SwiftUI?
SwiftUI is Apple's framework for declaring an app's user interface in Swift code. Learn what it does, how it meets AppKit and how NotchStar uses both.
What is AppKit?
AppKit is Apple's older framework for building Mac apps with windows, menus and events. Learn what it covers and why SwiftUI apps still use it.
What is MediaRemote on macOS?
MediaRemote is a private Apple framework that reports what is playing on a Mac. Learn why it is restricted since macOS 15.4 and how notch apps work around it.
What is hover intent?
Hover intent is a short delay before a hover opens something, so passing the pointer by does not trigger it. Learn how NotchStar tunes it at the notch.
What does open source mean?
Open source software publishes its source code under a license that lets others read and change it. Learn the definition and how it differs from closed source.
NotchStar app icon

Put your notch to work.

Buy it once for $4, activate it in a minute, and keep it. Not sure yet? Try every tool in the browser on the home page, or install the 7 day trial.