Page 1 of 1

Is "Find Next" possible by attribute (text colour)

Posted: 2021-01-08 16:08:07
by withoutFeathers
Hi,
I've tried the macros, the Find dialog, and the manual, and AFAIK it's not possible to do a "Find Next" search by attribute.

To clarify: I have text that has a certain colour applied, a shade of blue, here and there in a long book, and I have a reason for examining them one after another. Find Next would do this if it had been a style; but it's not, it's just an attribute.

There's a macro "Select By Attributes" that will allow me to find and select all of them. But I want to look at them one by one.

Is there a way to do this that I've overlooked?

As I'm writing this it occurs to me that I might try:

1. Select all the blue with that "Select By Attributes" macro.
2. Apply a style to them all, just for this purpose, with a special name (ie, "Normal -- Blue")
3. Then I should be able to use the Find dialog box to select each instance of the file, one after another.

Should work? --I'll go and try this on a Duplicate file for testing.

But if there is a more direct way I'd like to know about it also.

Thanks!
wF

Re: Is "Find Next" possible by attribute (text colour)

Posted: 2021-01-08 16:37:00
by johseb
Have you tried the Formatting Examiner palette? The FE is one of the most useful and flexible additions in NWP3.

You just have to select the attribute (blue text color in your case) and use the arrows.

Screen Shot 2021-01-09 at 01.30.10.png
Screen Shot 2021-01-09 at 01.30.10.png (25.69 KiB) Viewed 13599 times

Re: Is "Find Next" possible by attribute (text colour)

Posted: 2021-01-08 16:44:23
by phspaelti
To do an attribute sensitive search in Nisus using regular Find do the following
  1. Make sure you are set to Powerfind or Powerfind Pro
  2. "Clean out" the find box (i.e. make sure it has no residual attributes)
  3. Insert the Wild Card "Any"
  4. Select and apply the attribute—or combination of attributes—you want to search for
Of course the "Select by Attributes" macro is also a good option, as is the method suggested by johseb.

If you want to temporarily mark a selection for finding again, I find the best option are the highlight colors. They have the advantage that they don't conflict with styles. Using a style as you select would end up erasing other styles.

Re: Is "Find Next" possible by attribute (text colour)

Posted: 2021-01-08 18:50:00
by adryan
G'day, Philip et al

All these methods are fine, but there is a caveat: it depends on how the color was applied in the first place. By this I mean that they will only work if the chosen color is exactly the same in each instance. In all probability it is, but one way in which things could be otherwise is by pointing and clicking directly on a color palette (such as the Color Wheel or the Spectrum Image Palette). If the cursor is moved only slightly between color applications, the applied colors will have different RGB (say) values and hence not all be found at once.

One way of dealing with this is to find everything that is colored Black (say), then Invert Selection, color the result uniformly (so things are fixed for future manipulations), then Show Selection in Results Window. (See the Selection sub-menu of the Edit menu for these commands.) You can then step through the occurrences. Of course, this method assumes there are only these "two" colors in the document.

Cheers,
Adrian

Re: Is "Find Next" possible by attribute (text colour)

Posted: 2021-01-08 18:52:02
by withoutFeathers
@johseb, @phspaelti
Thank you both.

The Formatting Examiner is exactly what I need, and I'm delighted that I can use it for other things also.

And I've tested the 'Wild Card' method in the Find Dialog box, and it does the same.

And I've even discovered that there's a popup at the bottom of the page, when the text is coloured, that gives the same option.

Great. Now I have three ways to do it and don't have to bother with making styles! :D

wF

Re: Is "Find Next" possible by attribute (text colour)

Posted: 2021-01-08 19:00:50
by withoutFeathers
adryan wrote: 2021-01-08 18:50:00 All these methods are fine, but there is a caveat: it depends on how the color was applied in the first place. By this I mean that they will only work if the chosen color is exactly the same in each instance.
Agreed. I had planned for this (in a general way) by creating a splotch on the Apple Color pallet and always using the same splotch.

But that's a very interesting reverse method for times that wasn't done. And in fact I have some other work where there is some blue, but also some red and some green, denoting other things; as well as mostly black.

So it would be possible to walk through 'Find Next' for all the 'colored' (any color that's not black) at once, using your method, and perhaps I'll have occasion to do this also. Thank you.

wF

Re: Is "Find Next" possible by attribute (text colour)

Posted: 2021-01-11 11:20:41
by martin
Thanks to everyone for all the advice that's been shared. It's probably superfluous now, but our FAQ on searching for text formatting goes over a lot of the methods discussed here.
withoutFeathers wrote: 2021-01-08 19:00:50 So it would be possible to walk through 'Find Next' for all the 'colored' (any color that's not black) at once, using your method, and perhaps I'll have occasion to do this also. Thank you.
Adrian's advice to find all black text, invert the selection, and open a results list showing the selection is very clever– great suggestion!

Here's another solution for you: a Find Color Groups macro that shows a list of all non-black text in your document, grouped by similar colors.

Re: Is "Find Next" possible by attribute (text colour)

Posted: 2021-01-11 21:09:29
by withoutFeathers
martin wrote: 2021-01-11 11:20:41 Here's another solution for you: a Find Color Groups macro that shows a list of all non-black text in your document, grouped by similar colors.
Thanks Martin. That's potentially useful, but I'm having a problem with it in the Results List, which I ran into a few weeks ago also in some other search. It's that the Results List chops the text up as if there are hundreds of different instances, even where the colour is contiguous (continuous).

To clarify: using the "Find Color Groups Macro" on a document that has only two red sections (both only a few words) and three green sections (each several thousand words long), the Results List is showing me hundreds of green instances in the list. When I click on the yellow-highlights in the list, what happens is the selection just moves along through different chunks of the green text -- a clause or two at a time; sometimes more, somtimes less.

This seems silly, because I created those 3 green sections by shift-clicking and selecting the whole passage at once, for each one. So to be useful, the Find Color Groups is going to need to just show me 3 groups in the Results List, IMO. Otherwise it's not finding what I created -- a section of green text -- but rather deciding, by itself, that there are hundreds of bits of green text there in each one, one after another.

Can this behavior be changed? If not, I view it as a bug.

wF

Re: Is "Find Next" possible by attribute (text colour)

Posted: 2021-01-12 09:00:35
by martin
withoutFeathers wrote: 2021-01-11 21:09:29 That's potentially useful, but I'm having a problem with it in the Results List, which I ran into a few weeks ago also in some other search. It's that the Results List chops the text up as if there are hundreds of different instances, even where the colour is contiguous (continuous).
...
Can this behavior be changed? If not, I view it as a bug.
It's not a bug per se, since the poor macro is just doing what it was told to do :wink: But we can certainly change its behavior.

Please download and install a fresh copy of the macro. I've amended the macro so it should now do what you want, matching contiguous blocks of colored text as a single find result.

Re: Is "Find Next" possible by attribute (text colour)

Posted: 2021-01-12 12:16:33
by Þorvarður
Hello Martin,
thanks for the macro "‪Find Color Groups macro‪". It's very useful.

After testing it briefly, it seems to find all colors except red, and by "red" I mean Format > Text Color > Red. However, if the hue is slightly changed, it is found.

Could the macro be amended so that the default red can always be found?
Thank you very much and belated

Happy New Year
to everyone! :–)

Re: Is "Find Next" possible by attribute (text colour)

Posted: 2021-01-12 14:38:11
by martin
Þorvarður wrote: 2021-01-12 12:16:33 Could the macro be amended so that the default red can always be found?
That is a bug. Please download the Find Color Groups macro again. It should be fixed now so it also matches the default red color. It will also match grays now, which the prior macro also skipped.

Happy New Year to you too Þorvarður!

Re: Is "Find Next" possible by attribute (text colour)

Posted: 2021-01-12 15:46:14
by withoutFeathers
martin wrote: 2021-01-12 09:00:35
It's not a bug per se, since the poor macro is just doing what it was told to do :wink: But we can certainly change its behavior.

Please download and install a fresh copy of the macro. I've amended the macro so it should now do what you want, matching contiguous blocks of colored text as a single find result.
Nice! Shows contiguous blocks now. Great!

Thank you very much.

wF

Re: Is "Find Next" possible by attribute (text colour)

Posted: 2021-01-12 15:48:14
by Þorvarður
Þorvarður wrote: 2021-01-12 12:16:33 Could the macro be amended so that the default red can always be found?
That's it. Now it works like a charm!
Thank you.
:D :D :D :D :D :D