Page 1 of 1

Macros to Apply Styles

Posted: 2007-10-19 08:24:49
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!

Posted: 2007-10-19 14:17:59
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: