pb

A command-line interface to the Mac OS X Pasteboard


Description

pb is a command-line utility that lets you do several things in Mac OS X 10.3 and later:

Apple does not include a utility with Mac OS X that does any of these things. (The closest is Clipboard Viewer, but that uses the old OSTypes.)

pb is the successor to clipboard.


Usage

pb list

Lists the items on the clipboard, and the types that each item bears.

pb count

Tells you how many items are on the clipboard. Most useful in scripts, along with pb paste.

pb copy [UTI] [path]

Copies data [of a specific type] to the clipboard. By default, reads UTF-8 data from stdin.

pb paste [index] [UTI] [path]

Pastes data [of a specific type] [from a specific item by index] from the clipboard. By default, pastes UTF-8 data from the first item to stdout.

pb clear

Removes all items on the clipboard. Afterward, the clipboard contains no items, and you cannot paste in any application (until the next time you copy something).


Downloads

Not yet. I have some bugs yet to fix.


Mercurial repository

If you want to contribute bug-fixes or enhancements to pb, the easiest way to do that is to clone the Mercurial repository for pb. To do this, type this command into a terminal:

hg clone http://bitbucket.org/boredzo/pb

I provide pb—the program, and its source code—under a three-clause BSD license. For more information, see the file named LICENSE.txt that comes with it.


Version history

1.0


2008-09-09 http://boredzo.org/pb
Valid XHTML 1.0! Valid CSS!