Tag Archives: Plain text

Cleaning formatting from text on the Mac OS X pasteboard

There are a number of apps floating around that can strip rich text formatting from whatever you’ve copied to the pasteboard. I’m not sure why you’d need to buy an app for this. Here are two ways to get plain text.

⌘⌥⇧V – Paste and match style will give you plain text if you’re pasting into plain text. Otherwise you’ll get rich text that matches the formatting applied to wherever you’re pasting the text. I use this one a tonne in spreadsheets where I’m collecting information from web pages.

pbpaste | pbcopy – run this at the command prompt. It just pipes the pasteboard contents back into the pasteboard, but will remove all formatting as a result.

Open a Word Doc as text in Coda

I often get content for sites in Word docs which I used to open in Pages. Getting the text out of pages involved far too much clicking, particularly if I was extracting a URL from text in a table. To save my wrists, I figured out the following:

catdoc file.doc | coda >> temp.txt

catdoc converts the Word file into plain text, and outputs to STDIO. I pipe that into Coda using coda-cli. For some odd reason, I need to provide the temp.txt throw-away file, or Coda doesn’t respond. The result is a new tab in Coda with the contents of the Word document.

catdoc and coda-cli can be installed using Homebrew.