Improving the Form Paragraph macro

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

Improving the Form Paragraph macro

Post by vitaka » 2010-06-05 10:53:11

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: 4361
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Improving the Form Paragraph macro

Post by martin » 2010-06-06 13:39:48

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: 17
Joined: 2007-10-25 11:41:30

Re: Improving the Form Paragraph macro

Post by vitaka » 2010-06-07 20:27:30

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

Post Reply