views:

19

answers:

4

I am looking for ways to quickly converting blocks of text created in Word, etc. into plain text (i.e. turning right and left quotation marks into "plain text" quotation marks) for quickly transferring content to code with as few headaches as possible.

I came across this:

http://www.softpedia.com/get/Office-tools/Other-Office-Tools/Keith-Fenske-Plain-Text.shtml

...but it is Windows only and I prefer to dev on a Mac. Does anyone have a suggestion for an OSX tool or better yet a web app?

A: 

Paste the text into TextEdit. Go to the Format menu => click Make Plain Text. Done.

TextEdit comes with OS X.

Matt Ball
Sorry but that doesn't seem to convert things like left and right quotation marks to their unicode equivalent, I should have been more specific.
jerome
A: 

Text Wrangler from Bare Bones Software. This is BBEdit's free little brother (which will also do what you want).

Robert Calhoun
Just saw your comment about wanting to do more than just straighten them. You can make a script in BBEdit that does this; see for example http://www.chriscassell.net/log/2004/12/06/applescript_to_.html .
Robert Calhoun
+2  A: 

If you're using Snow Leopard, it's easy to create a Service to clean text. Run /Applications/Automator, choose the Service template, set it to receive text in any application, and enable replacing the selected text. Add a Run Shell Script action to the workflow, with Pass Input set to stdin. For the actual script, paste this in in place of the template (cat):

LC_CTYPE=en_US.UTF-8 tr '‘’‛❛❜“”‟❝❞‐–—­‒‑' "['*5]"'["*5][-*6]'

(note: hopefully all the various funny characters I included in the first string will pass through our various web interfaces intact... if not, edit the collections of quote marks to include whatever you need to squash in the first string, and matching numbers of their plain-text equivalents in the second string. And feel free to add other replacements as needed.)

Anyway, save this Service with some reasonable name, and then to invoke it just select some text (in any Cocoa app -- not, unfortunately, MS Word), and select your service from the application menu -> Services submenu. Also, you can use the Keyboard preference pane to assign it a keyboard shortcut if you like.

Gordon Davisson
Excellent. TY very much.
jerome
A: 

The "Plain Text" Java application will run on Linux, Mac OS, and Windows.

Keith F.