Thursday, August 26, 2010

PureText

Formatted text in the clipboard can be very annoying to paste into rich-text-aware destination applications. Here's a scenario I see a lot, you ctrl+c some information from a Microsoft Word document, your clipboard has all that information as well as formatting information, junk like this is sitting in the clipboard:
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span  lang="DE" ><o:p><span > </span></o:p></span></p>

You then open your Microsoft Exchange email client and paste in the text and yuck, the font has changed to comic sans at 44 point size in bright Green. You just wanted the text to paste in, but you got a lot more.

The quick and dirty solution is to open a plain text editor and paste the text there, then replace the clipboard with a ctrl+c from the plain text editor.
  1. Ctrl+c the formatted text
  2. Open notepad
  3. Ctrl+v, the formatting is gone
  4. Ctrl+a, to select all unformatted text
  5. Ctrl+c, replace the clipboard with unformatted text
  6. Alt+Tab,Tab,Tab to get the target Application window
  7. Ctrl+v, paste in unformatted text into the target application

Microsoft has provided a quick menu when pasting text that you can use to remove formatting, eliminating some of the annoyance but that only helps when you use their software. If you aren't able to eliminate the formatting, you could be left with having to manually re-style the pasted text, which is painfully time-consuming and frustratingly unnecessary busy work.

PureText can help out here, it essentially performs the steps to remove formatting for you each time you press ctrl+v. So to paste plain text copied from a richly formatted source with PureText installed you simple do this:
  1. Highlight the text to copy
  2. Ctrl+c, clipboard has the formatted text
  3. Switch to the target application
  4. Ctrl+v, glorious unformatted plain text is magically pasted in
The program can be mapped to a different keyboard shortcut from ctrl+v in case you want to sometimes preserve the formatting of copied text. In that situation ctrl+v works as usual, ctrl+p (or whatever key press you decide to use) will paste in the plain text.

A tool like this would be an excellent productivity enhancer for anyone who is authoring with browser WYSIWYG text editors like TinyMCE, and having to cut and paste between other sources. These in-browser editors are have some rich text functionality, but usually just enough to cause problems when pasting and you end up putting a lot of junk like special font settings and “Microsoft specific characters” into your application database by using ctrl+c, ctrl+v without it. This invisible styling then rears it's ugly head when you try to present the material in a browser, you get lots of square boxes in contractions or hyphenations as well as mysterious font changes as the styling interacts in unpredictable ways with the HTML page styles and CSS.

1 comment:

Harley said...

Google Chrome has a built-in feature for this ctrl+shift+v will paste just the text. Cool: http://chrome.blogspot.com/2010/09/tip-just-text-please.html

About Me

My photo
Lead Java Developer Husband and Father

Tags