Macros to Apply Styles

Get help using and writing Nisus Writer Pro macros.
Post Reply
lawrencegoodman
Posts: 30
Joined: 2007-07-30 12:06:49

Macros to Apply Styles

Post by lawrencegoodman »

Now that I am a full-fledged Nisus Pro license holder (yeah!), I feel more qualified to pester Martin for macro advice.

I am looking to create a macro that applies a particular style to certain text.

So, for example, if a paragraph begins with a "(" I want Nisus to apply the style "Parenthesis."

If a paragraph begins with three or more Uppercase letters in a row, I want Nisus to apply the style, "Character."

I am a playwright so these macros would come in mighty helpful.

Thanks for a great product!
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Post by martin »

These kinds of macros will require a simple combination of find commands and style menu items. Basically you'll want to find the text that meets your criteria and then apply your style.

So, your parenthesis macro might look like this:

Code: Select all

Find '^\(.+$', 'aE'
Format:Character Style:Parenthesis
The first line is a PowerFind Pro expression that finds all paragraphs that start with an open parenthesis. The second applies your style to all found paragraphs. If you're uncomfortable with PowerFind Pro, you can use PowerFind instead. Just construct the expression in the Find panel and paste it into your macro:

Image
Post Reply