Reply to topic  [ 2 posts ] 
incompatible NWE macro(s) and thanks for a major upgrade. 
Author Message

Joined: 2006-08-19 18:35:27
Posts: 213
More than a year ago, I have bugged martin to helped me in writing 'simple' macros which type hebrew texts. those macros have been in extensive use since then in NWE.
In the process of moving to NWP, we have discovered that all these macros are (apparently) incompatible with NWP. SInce the manual claims for compatibility I give here an example of an old macro, which still types the hebrew text, but looses all attributes.

This is done just for the sake of info, in case it interests nisus people, as I re-wrote all the macros with the new menu-driven language, and to my surprise and satisfaction- until now everything works with hebrew texts with no problem and- composition is very easy.
So this is to thank nisus people for this major upgrade- great!

Quote:
#Nisus Macro Block
#Send Text as RTF
#source front selection
#destination front selection
#after execution
#Format:Remove Attributes and Styles
#Format:Paragraph Alignment:Align Right
#End Nisus Macro Block
use utf8;
binmode(STDIN, ":utf8");
binmode(STDOUT, ":utf8");

$message = '\u1492 ?\u1493 ?\u1505 ?\u1523 ?';
$fontSize = 9; # in points

$rtfSize = $fontSize * 2;
print "{\\rtf1\\mac{\\lang1037\\fs$rtfSize $message}}";


2007-10-09 02:36:04
Profile
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
Post 
Thanks for the post- it looks like the problem is due to a change in selection behavior for Perl macros. In Express 2.7 the text a Perl macro inserted was never selected, but in Pro (and Express 3.0) this text is selected after the macro finishes. This means the "Remove Attributes and Styles" command is then applied to the inserted text, removing the font size that had been applied.

I'll file a bug that these stand alone Perl macros should keep the behavior set forth in Express 2.7.

Also, though I know you've already transferred your macros over to the new macro style I'll give a solution in case anyone else has the issue. Simply insert the command "Select End" at the start of the "after execution" block. Eg: your example macro becomes:

Code:
#Nisus Macro Block
#Send Text as RTF
#source front selection
#destination front selection
#after execution
#Select End
#Format:Remove Attributes and Styles
#Format:Paragraph Alignment:Align Right
#End Nisus Macro Block
use utf8;
binmode(STDIN, ":utf8");
binmode(STDOUT, ":utf8");

$message = '\u1492 ?\u1493 ?\u1505 ?\u1523 ?';
$fontSize = 9; # in points

$rtfSize = $fontSize * 2;
print "{\\rtf1\\mac{\\lang1037\\fs$rtfSize $message}}"


2007-10-09 13:00:49
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:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software