nisus.com
https://www.nisus.com/forum/

Transform text between ++ to comments
https://www.nisus.com/forum/viewtopic.php?f=17&t=3795
Page 1 of 1

Author:  thf [ 2010-06-22 04:48:34 ]
Post subject:  Transform text between ++ to comments

Hi, im looking for a macro whih transfers a text between ++ symbols to comments. Is there any possibility to achieve this. my text goes something like this

bla bla bla ++explicate this++ bla bla bla

any help?

Yours tom

Author:  martin [ 2010-06-22 08:48:33 ]
Post subject:  Re: Transform text between ++ to comments

Hi Tom- a macro like that is not too tough. Here's one:
Code:
Select Document Start
While Find Next '\+\+\s*(.+?)\s*\+\+\s*', 'E$'
   Delete
   Add Comment
   Insert Attributed Text $1
   Go to Marked Text
End

That will preserve any formatting applied to the comment text. If you want to strip formatting from the comments, you can change the "Insert Attributed Text" command to just "Insert Text".

Author:  thf [ 2010-06-22 11:19:17 ]
Post subject:  Re: Transform text between ++ to comments

Thanks a lot. I have found almost everything I need for the german version, which comes that way.

Select Document Start
While Find Next '\+\+\s*(.+?)\s*\+\+\s*', 'E$'
   Löschen
Kommentar erstellen
   Insert Attributed Text $1
Gehe zum markierten Text
End

I don't know if the question ever arised, but it would be very helpful if the macros wouldn't be language dependent (maybe in a future version?)

Yours,
Thomas

Did I say "Thank you!" - i didn't: shame on me :oops: Thank you, the macro does a perfect job.

Author:  martin [ 2010-06-25 09:32:27 ]
Post subject:  Re: Transform text between ++ to comments

I'm glad you got it working (and translated) Thomas.

Yes, it would be much better if one didn't have to translate the menu names in a macro. It's an annoyance we wish didn't exist, but the situation is a little complicated, so I'm not sure you'll see any progress soon.

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/