Form Paragraph Macro

Get help using and writing Nisus Writer Pro macros.
Post Reply
hatchmo
Posts: 99
Joined: 2004-03-01 10:35:56
Location: Cotati, CA

Form Paragraph Macro

Post by hatchmo »

Earlier versions of Nisus Writer used to ship with a "Form Paragraph" macro that preserved double-spaces in the selected text.
Does anyone still have that routine/macro you could post for me? I'm having a tough time converting the perl macro so that it doesn't turn all the selected text into one massive paragraph.
Al Hatch
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Post by martin »

The "Form Paragraph" macro that ships with NWP should preserve any double-spaces in your text. It's default menu location is Macro > changing text > Form Paragraph. In case something happened to the macro, here it is:

Code: Select all

#Combines selected lines into one paragraph
Find and Replace '[\n\r]+', ' ', 'Esa'
Find and Replace '  +', ' ', 'Esa'
hatchmo
Posts: 99
Joined: 2004-03-01 10:35:56
Location: Cotati, CA

Post by hatchmo »

I believe that's the problem.

Code: Select all

Find and Replace '[\n\r]+', ' ', 'Esa'
Replaces all double-spaces with a space. I would like it not to do that.
Al Hatch
hatchmo
Posts: 99
Joined: 2004-03-01 10:35:56
Location: Cotati, CA

Post by hatchmo »

I changed that line to

Code: Select all

Find and Replace '[\n\r]{1}', ' ', 'Esa'
So that it replaces only single occurences of a return. I think the default macro shipped with a typo.
Al Hatch
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Post by martin »

hatchmo wrote:

Code: Select all

Find and Replace '[\n\r]+', ' ', 'Esa'
Replaces all double-spaces with a space. I would like it not to do that.
Did you quote the wrong line of code? That line replaces one or more newlines, it does not replace any spaces, single or double. Or perhaps you meant that you wanted to preserve double-newlines?
Post Reply