Page 1 of 1

On non-contiguous selection & macros

Posted: 2006-12-12 04:39:22
by ojamandar
How can I put non-contiguous selections in paretheses all at once? The macro I have with NWE 2.7 is:

#Nisus Macro Block
#source front selection
#destination front selection
#End Nisus Macro Block
binmode(STDIN, ":utf8");
binmode(STDOUT, ":utf8");

read STDIN,$text,10000;
$text = "($text)";
print $text;

All it does for me is adoin the first and the last selection and make them contiguous and put the newly formed string in paentheses. Similar things happen with Quote Selection Macros? Please someone out there, help me out of this situation.

Posted: 2006-12-12 07:11:25
by dshan
I don't think you can do this. Non-contiguous blocks of selected text are passed to Perl as a single block of concatenated text, this behavior prevents their use with Perl macros. I really wish Nisus would do something about this...

Posted: 2006-12-12 13:43:56
by martin
dshan is correct, you won't be able to accomplish what you want at this time, sorry.

Posted: 2006-12-14 20:18:32
by ojamandar
Thank you very much.

p.s. I can change non-contiguously selected items into italics, for instance, by pressing Command+I, so I thought maybe I should be albe to ...