Attribute sensitive Find and Replace

Get help using and writing Nisus Writer Pro macros.
Post Reply
Posts: 3
Joined: 2008-04-18 09:17:38

Attribute sensitive Find and Replace

Post by matt_wiseman » 2008-07-09 08:05:04

Why doesn't this macro work? Its goal is to place a "±b±" in front of any text that carries the bold attribute and a "±/b±" after, and etc.. This lets me translate these attributes to my final product in InCopy and InDesign. If I create these expressions in the find/replace dialog, they work just fine, but that's a manual process.

In case it does not show up on your browser, I am applying the appropriate attribute to the ".+" in the Find Expression of each line.

#Mark any BoldItalic Text
Find and Replace ‘(.+)’, ‘±bi±\1±/bi±’, ‘Eau’

#Mark any Bold Text
Find and Replace ‘(.+)’, ‘±b±\1±/b±’, ‘Eau’

#Mark any Italic Text
Find and Replace ‘(.+)’, ‘±i±\1±/i±’, ‘Eau’

Posts: 496
Joined: 2007-03-03 09:55:06
Location: Europe

Re: Attribute sensitive Find and Replace

Post by Groucho » 2008-07-09 08:59:45

It works flawlessly in my computer. Remember to save the macro as a Nisus Macro (.nwm).

Cheers, Henry.

User avatar
Official Nisus Person
Posts: 4495
Joined: 2002-07-11 17:14:10
Location: San Diego, CA

Re: Attribute sensitive Find and Replace

Post by martin » 2008-07-09 11:58:56

You might make sure there are no stray attributes in your macro file. I'd select all your text and use the menu Format > Remove All Attributes and Styles. That menu does everything except remove the "Normal" style, so afterwards you'll also want to use Format > Paragraph Style > Remove Paragraph Styles. That should ensure your text is free from any unwanted attributes so you can apply the bold/italic as desired.

Post Reply