Page 1 of 1

Attribute sensitive Find and Replace

Posted: 2008-07-09 08:05:04
by matt_wiseman
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’

Re: Attribute sensitive Find and Replace

Posted: 2008-07-09 08:59:45
by Groucho
It works flawlessly in my computer. Remember to save the macro as a Nisus Macro (.nwm).

Cheers, Henry.

Re: Attribute sensitive Find and Replace

Posted: 2008-07-09 11:58:56
by martin
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.