Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Pasting multiple items

Jason Milkins edited this page May 14, 2018 · 21 revisions

Advanced use...

Multi item select and paste

CutBox also allows you to select multiple pasteboard items and paste them all back in one go.

For example, let's say I have a bunch of web links I want to collect.

  1. Right click each link and copy address
  2. Repeat (1) until I've copied them all
  3. Switch to the application you want to copy all the links to
  4. Open CutBox switch to regexp mode with [Cmd + S] (you'll see search mode change at the bottom right)
  5. Search CutBox for https?:
  6. Select all the links you want to paste with mouse and/or keyboard shortcuts
  7. Press enter to paste all the items.

All your links will be pasted with new-lines in between each one.

Join items with strings and/or wrap them

Mutli-item paste is configurable so you can choose a string to join between the items, and you can also wrap a pair of strings around the start and end.

For example, if I wanted to collect a list of numbers from various different place to paste into a piece of code, usually I'd need to edit them after copy pasting them one by one.

With CutBox I don't have to do that. Now I can just do this:

  1. Set CutBox search mode to regexp

  2. Set my join and wraping strings up in CutBox preferences

  3. e.g. my target is JavaScript code, I want to use an array of decimal numbers

    1. Set my join string to ,
    2. Set wrapping on
      1. Set my start string to let numberArray = [
      2. Set my end string to ]
    3. close preferences
  4. Copy each item, from wherever they are until I've copied them all

  5. Switch to my code editor

  6. Open CutBox search and enter ^\d+\.\d+$ (i.e. match all floating point numbers)

  7. Select the items with the mouse / keyboard

  8. Press enter to paste all the items.

  9. (Assuming you copied these numbers: 93.13 44.52 52.21 32.14)

  10. You'll have something like...

     let numberArray = [32.14, 52.21, 44.52, 93.13]
    

Note: at the moment the sort order of the items will be in the reverse order you copied the items. For example, I copy 1, then 2, then 3, When I paste them back... I get 3 2 1.

You can use wrapping and joining to do a bunch of things. I'm interested to hear what you use it for. Tweet me at @ocodo

If you'd like more features in CutBox open a new issue and mark it enhancements.