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.
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.
Here’s a great way to set up a global find and replace in a document.
- You have a document that has a block of text that is repeated throughout the document
- You spend time editing one of the blocks of text
- You’d like to do a global find-and-replace to substitute the old text for the new text
- Select the new text you wrote and invoke Copy (⌘C)
- Select the old text and invoke Use Selection For Find (⌘E)
- Bring up the Find-and-Replace interface for the application
- Note the Find field is already filled out
- 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.
For small find-and-replace operations, you can use the selection pasteboard and not involve the Find-and-Replace interface.
- Select the content you want to search for and invoke Use Selection For Find (⌘E)
- Select the content you want to use to replace it and invoke Copy (⌘C) to put it on the system pasteboard
- InvokeFind Next(⌘G)
- Invoke Paste (⌘V)
- 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.