Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

TorgoX (1933)

TorgoX
  sburkeNO@SPAMcpan.org
http://search.cpan.org/~sburke/

"Il est beau comme la retractilité des serres des oiseaux rapaces [...] et surtout, comme la rencontre fortuite sur une table de dissection d'une machine à coudre et d'un parapluie !" -- Lautréamont

Journal of TorgoX (1933)

Tuesday June 17, 2003
11:35 AM

Clipboard and RTF

[ #12905 ]
Dear Log,

A major bit of happiness, years ago, was when I discovered MacPerl and how to manipulate the clipboard (in a text-only form, alas) from Perl. And on MSWin, there is Win32::Clipboard, for doing just that. I've recently been talking with that module's author, Aldo Calpini, about making it easier to read and write to the non-plaintext parts of the clipboard. Notably, when I'm in MSWord or whatever, and select and copy some text, it gets put in the clipboard in several different formats. Some are in an internal format specific to MSWord (or whatever application), some are just versions of plaintext, but there's also several styled text formats, which preserve font name and size, formatting features like italics and bold, etc..

Apparently the de-facto "standard" format for expressing styled text on the MSWin clipboard is Rich Text Format, RTF. That pleases me!

With the next version of Win32::Clipboard, I should be able to read the RTF from Perl, alter it, and put the altered version back on the clipboard. Whee!

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • You might also have an interest in the latest version of nisus [nisus.com] which now supports Perl filters/macros. According to the PDF manual [nisus.com] (pp 111,112), you can opt to have a macros work with RTF rather than plain text. The script will get RTF input and the script's output will be interpreted as RTF.

    I used to use Nisus back when I was a phil student at UCSD. It's a great word processor (my favorite of the many I've used on various platforms over two decades). Now that I'm not writting papers every day, I no longer