ENTRIES
Welcome to Eric Cheng's online journal! You are not logged in. [ Log in ]
« How to block and hide Facebook applications and requests :: index :: Too much computering around here »

Applescript to convert clipboard rich text to plain text

:: Saturday, January 26th, 2008 @ 11:36:09 am

:: Tags:

I struggled for months with copying rich text into the clipboard and then trying to paste it back out as plain text. I do this a lot when copying and pasting formatted text into text areas in certain websites, some of which are sort of aware of rich text (the end result is never what I want).

Previously, I used my favorite text-only application, TextMate, as a cut ‘n paste proxy to get plain text. I’d paste the RTF text snippet into a new document, and then copy it out again to paste into my final destination. This was clearly not very the best way to do things.

These days, I use a combination of Applescript and Quicksilver. I can convert the clipboard to plain text in a fraction of a second.

Here’s the Applescript, which I found at macoshints.com:

try
  set the clipboard to string of (the clipboard as record)
on error errMsg
  display dialog errMsg
end try

I compiled and saved this script as an executable. Using Quicksilver, I can invoke the script using the keyboard nearly instantaneously. Here’s a video of me copying and pasting rich text, converting the clipboard to plain text, and then re-pasting. I pause for just a moment when invoking Quicksilver because otherwise, it would be impossible to see.

Get the Flash Player to see this player.

On another note, I’m really enjoying using SnapzProX to make all these movie screenshots. I’m using ffmpegx to convert them to Flash, and am displaying them in my journal with Flash Video Player plugin for Wordpress.

| Popularity: 2% | Oakland, CA | link | trackback | Jan 26, 2008 11:36:09

:: leave a reply

Use: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

RECENT MICROBLOG ACTIVITY
  • I forgot how beautiful SF gets in October. 3 hrs ago
  • They are just pacing back and forth, and back and forth. I wonder what is going on up there. 3 hrs ago
  • I can't wait until my upstairs neighbors finish moving in and stop stomping around all day. 3 hrs ago
  • I love GG's visits. "I'm in town. SURPRISE!" :) 21 hrs ago
  • Quarterly CMYK hell. Fun stuff. :) 23 hrs ago
  • Going to sleep before 2am! Hooray! 1 day ago
  • Went to a gathering tonight where Claude Frank performed at a home concert hall. Incredible experience and company. 1 day ago
  • I have discovered the color brown. 1 day ago
  • There is a sci-fi moon in the sky right now. 1 day ago
  • What not to do: Shoot - Nuke in Photoshop - Save as JPG - Re-open - Upres 1300% - Re-save as JPG - Deliver to Editor 1 day ago
  • More updates...

Posting tweet...

ARCHIVES
Journal Home
Where is Eric? (password)
Stuff for Sale
October 2008 (16)
September 2008 (25)
August 2008 (34)
July 2008 (34)
June 2008 (32)
May 2008 (26)
April 2008 (15)
March 2008 (19)
February 2008 (31)
January 2008 (43)
December 2007 (33)
November 2007 (29)
October 2007 (29)
September 2007 (9)
August 2007 (19)
July 2007 (10)
June 2007 (17)
May 2007 (26)
April 2007 (38)
March 2007 (39)
February 2007 (13)
January 2007 (35)
December 2006 (35)
November 2006 (14)
October 2006 (6)
September 2006 (20)
August 2006 (24)
July 2006 (32)
June 2006 (17)
May 2006 (23)
April 2006 (16)
March 2006 (16)
February 2006 (26)
January 2006 (34)
December 2005 (17)
November 2005 (21)
October 2005 (18)
September 2005 (17)
August 2005 (5)
July 2005 (15)
June 2005 (20)
May 2005 (25)
April 2005 (7)
March 2005 (22)
February 2005 (20)
January 2005 (38)
December 2004 (6)
November 2004 (24)
October 2004 (16)
September 2004 (22)
August 2004 (12)
July 2004 (17)
June 2004 (15)
May 2004 (11)
April 2004 (35)
March 2004 (40)
February 2004 (29)
January 2004 (36)
December 2003 (20)
November 2003 (18)
October 2003 (10)
September 2003 (18)
August 2003 (10)
July 2003 (34)
June 2003 (12)
May 2003 (49)
April 2003 (42)
March 2003 (42)
February 2003 (15)
January 2003 (7)
December 2002 (17)
November 2002 (19)
October 2002 (24)
September 2002 (22)
August 2002 (20)
July 2002 (21)
June 2002 (14)
May 2002 (15)
April 2002 (11)
March 2002 (13)
February 2002 (20)
January 2002 (17)
December 2001 (16)
Even Older Journal
Travel Journals

VIENNA TENG
Support my friend and favorite singer-songwriter, Vienna Teng!

--- Next Show ---

Schedule coming soon.
[ discography ]

Eric Cheng's RSS Journal Journal RSS
Eric Cheng's RSS Journal Comments RSS

Rice Bowl Journals

proudly powered by wordpress
script exec time: 0.57s
i hate computers.