Search

Enter a search word or two and press return to see the search results.

Who am I?

Hi, I’m Graeme and these are my notes, from my messy desk. I started this blog because Google proved to be more useful at finding content than anything else I’ve used.

So I started adding my own content in the hopes that Google would index it and allow me to find things again in the future.

It works.

You can find out more about me here, and you should follow me on Twitter here.

Keeping up

You can automatically receive new content here by subscribing to the “Blog RSS” (link below). This is the easiest way to keep up with what I write here.  See this BBC article for a good introduction on RSS and keeping up with the goings on of the Internet more easily.

« The risks of Quicken | Main | Open Sauce Podcast »
Friday
Aug262005

Pasteboard in Mac OS X

I've just discovered a couple of nice things about the Pasteboard (or clipboard as it's called in every other UI!) in Mac OS X.

You can manipulate the Pasteboard from the command line interface with pbcopy (which takes from stdin and copies it to the clipboard) and pbpaste (which dumps the content of the clipboard to stdout). This means that, for example, you can dump the output of a shell script straight to the clipboard, rather than letting it flow to stdout, then selecting and copying the output from the terminal (something I do quite often, particularly when I'm trying to write documentation or tutorials).

The other thing I learned (both from the pbcopy(1) manual page and from a post on the TextMate users mailing list) was that there are multiple Pasteboards in Mac OS X. According to the man page, they are named 'general', 'ruler', 'find' and 'font'. General is where stuff goes by default. I've don't know what 'ruler' and 'font' do, but I can guess they're for copying and pasting particular artefacts (so you can copy'n'paste text formatting rather than the text itself in the case of 'font'?). Find is an interesting one. Select a piece of text in a Cocoa app. Hit ⌘-E to copy this text to the 'find' pasteboard. Now go to the 'find' window. Note that the text you pushed to the 'find' pasteboard is now in the 'Find' box, automagically. And it's all done without disturbing what's currently on your main pasteboard.

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments (1)

Ahhh! So *that's* why, when I entered a find string in TextMate, and then opened up the file in BBEdit and opened its find dialog...the string was already there.

It really creeped me out when it happened. Way too prescient. Now I know why :)

October 11, 2005 | Unregistered CommenterGavin Kistner

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>