« I see London. I see France. | Main | Paste Clipboard Contents as Plain Text: An AppleScript »

Convert RTF Clipboard Contents to Plain Text

Much of the work I've been doing recently involves moving information between PDF and RTF documents. Often, the information I'm copying is formatted and Mac OS X presently copies that formatting by default. As a result, pasted text retains the formatting of the original copied text. This is usually unnecessary and often undesirable, especially if the formatting makes the text difficult to read in its new context.

As many of you know, however, converting RTF-formatted text on the clipboard to plain text is a nightmare. My old standby used to be to switch to BBEdit, open a new window, paste the clipboard contents, copy the pasted text, and switch back to the document I wanted to paste the text in. This is fine for a few pieces of information, but not when your workflow is built of shuttling bits of information back and forth between two RTF-sensitive contexts.

There are many solutions to route around this Mac OS X "feature", some of which cost money and others which are free but don't work reliably.1

With frustration pracically flowing out of my eyeballs, I scoured Google results until I found a blog post by Nobumi Iyanaga which has an AppleScript at its end called "clip2pure_text". I modified the script so that it copied the results back to the clipboard like so

saved the script as a run-only application, and set up a keyboard shortcut with Keyboard Maestro to invoke the AppleScript application.2

The result is pure plain text goodness. end of article

Notes
1 I used to use Carsten Blüm's Plain Clip, but the program seems these days to run once, after which it seems to do nothing at all.
2 I submitted a version of this post and its AppleScript to MacOSXHints. At the time of this writing, my hint is rated 4.5 of 5 stars.