Improving the Form Paragraph macro

Get help using and writing Nisus Writer Pro macros.
Post Reply
vitaka
Posts: 18
Joined: 2007-10-25 11:41:30

Improving the Form Paragraph macro

Post by vitaka »

How could I modify the Form Paragraph macro (Find and Replace '(\S)[\t\x20]*\n(?![\n>])', '\1\x20', 'EasS') so that it first removes blank lines, as in the Add Remove Blank Lines macro, so that I can form a paragraph even across paragraphs that contain blank lines?
User avatar
martin
Official Nisus Person
Posts: 5228
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Improving the Form Paragraph macro

Post by martin »

You could go about this two ways. The first would be to just combine the relevant lines of code from both macros and run them in succession:

Code: Select all

# First delete all blank paragraphs
Find and Replace ‘\n\n+’, ‘\n’, ‘EasS’

# Combines selected lines into one paragraph
Find and Replace '(\S)[\t\x20]*\n(?![\n>])\x20*', '\1\x20', 'EasS'
Or you could modify the "Form Paragraph" search expression so that it matches empty paragraphs as well:

Code: Select all

Find and Replace '(\S)[\t\x20\n]+(?!>)\x20*', '\1\x20', 'EasS'
vitaka
Posts: 18
Joined: 2007-10-25 11:41:30

Re: Improving the Form Paragraph macro

Post by vitaka »

Awesome! I like the second solution more elegant. Thanks!
Post Reply