Reply to topic  [ 2 posts ] 
Perl Header: Send Text as RTF 
Author Message

Joined: 2003-07-22 01:31:29
Posts: 32
Can you pass on any references or guidance in terms of how the #Send Text as RTF header might be used as a means of manipulating attributed text within a Perl block. I'm wondering if I could build some commands around these to make up for the aspects of attribute-sensitive PowerFind Pro that are not working (as delineated in a bug report submitted on 7/17).

The manual makes an intriguing reference to it, but offers no details.


2007-07-18 00:21:17
Profile
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
Post 
Once you start passing text to Perl as RTF you're in for some real work on the Perl side. Basically your Perl code will need to parse/understand whatever RTF codes NWP uses to encode the formatting you're interested in. Sometimes it can be simple, like "\b" indicating some text is bold. Other times it's hard, like "\f3", where the 3 is an index into a font table that appeared earlier in the RTF.

You'll probably have to experiment and see if the task you want to accomplish is feasible. One tip: you can use the Encode RTF and Decode RTF macro commands to selectively encode/decode text.

An example macro that inspects the RTF used for the currently selected text:
Code:
$text = Read Selection
$rtf = Encode RTF $text
New
Insert Text $rtf


2007-07-18 01:13:31
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software