Page 1 of 1

Find style not working

Posted: 2015-06-27 17:00:56
by brsnyder
Hi --

I duplicated the macro "Find all and show context" (after I updated it so it worked) and edited it so the Find expression is a style. The dialog box pops up and shows that I want to find

Character Style "xref"

which is correct. There are 3 chunks of text in my document with this style. But it is saying there are no matches.

The statement where I set the Find expression is:

$findExp = $doc.styleWithName 'xref'

I've tried with both paragraph and character styles and still no results. Am I doing something wrong, or does this feature not really exist as documented?

"As of v2.0.5 the findText argument can also be a Style object instead of some text. If a style is given, then will match any text with that style applied."

I'm using 2.1.1.

Thanks -- Barbara

Re: Find style not working

Posted: 2015-06-29 16:30:39
by brsnyder
Well after much trial and error, I figured out that the Find box was set on Normal and it needed to be on one of the PowerFind settings. So I added that to the macro and it works.

Re: Find style not working

Posted: 2015-06-29 21:55:57
by phspaelti
Glad to see that you got it working. Just for info purposes you might take a look at the following macro:
http://www.nisus.com/forum/viewtopic.ph ... 078#p25078

Re: Find style not working

Posted: 2015-06-30 08:40:30
by brsnyder
I kind of did that. I used the "Find all and show context" and modified it to "Find all xref style and show context." The extra step of adding the xref style is the piece I had to figure out. I'm coming from FrameMaker, where you can search directly for xrefs. So I'll just have to remind myself (or create another macro!) to apply the style when I create the xref.

Thanks -- Barbara