The three different clipboards

The three different clipboards

When you use Copy (⌘C), the selected content is written to the system clipboard (aka clipboard), replacing what was already there. This is great until you find you really need to carry more bits of data around. Turns out that macOS actually has two additional clipboards:

  • Dragging clipboard
  • Selection clipboard

Here are scenarios where each of these pasteboards could be very handy.

Dragging Pasteboard

Here’s how you can juggle two items of data using multiple clipboards.

  • Invoke Copy (⌘C) something to the pasteboard
  • Before pasting, see that you have some content you’d like to copy or move somewhere else in the document
  • Select the text and drag or option-drag (for copy) to a new location
  • Paste the test from the System Clipboard somewhere else

Drag-and-drop is a great way to accomplish what could also be done with Cut/Copy/Paste without overwriting the system clipboard.

Selection Pasteboard

Here’s a great way to set up a global find and replace in a document.

  1. You have a document that has a block of text that is repeated throughout the document
  2. You spend time editing one of the blocks of text
  3. You’d like to do a global find-and-replace to substitute the old text for the new text
  4. Select the new text you wrote and invoke Copy (⌘C)
  5. Select the old text and invoke Use Selection For Find (⌘E)
  6. Bring up the Find-and-Replace interface for the application
  7. Note the Find field is already filled out
  8. Click into the Replace field and Paste

This is the example of the selection pasteboard, which does not interfere at all with the system clipboard. Note that the selection pasteboard also crosses application boundaries, so you can grab content from one app and use it to search in another one without overwriting the system clipboard.

Extra Credit

For small find-and-replace operations, you can use the selection pasteboard and not involve the Find-and-Replace interface.

  1. Select the content you want to search for and invoke Use Selection For Find (⌘E)
  2. Select the content you want to use to replace it and invoke Copy (⌘C) to put it on the system pasteboard
  3. Invoke Find Next(⌘G)
  4. Invoke Paste (⌘V)
  5. Repeat steps 3 and 4

If the app doesn’t do wraparound search, make sure that the text you select in Step 1 is the first instance of said text.