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

Everything related to our flagship word processor.
Post Reply
withoutFeathers
Posts: 140
Joined: 2013-03-19 16:22:50

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

Post 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
johseb
Posts: 47
Joined: 2016-02-13 10:01:29

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

Post 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 13578 times
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

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

Post 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.
philip
adryan
Posts: 561
Joined: 2014-02-08 12:57:03
Location: Australia

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

Post 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
MacBook Pro (M1 Pro, 2021)
macOS Ventura
Nisus Writer user since 1996
withoutFeathers
Posts: 140
Joined: 2013-03-19 16:22:50

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

Post 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
Last edited by withoutFeathers on 2021-01-08 19:05:09, edited 1 time in total.
withoutFeathers
Posts: 140
Joined: 2013-03-19 16:22:50

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

Post 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
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

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

Post 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.
withoutFeathers
Posts: 140
Joined: 2013-03-19 16:22:50

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

Post 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
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

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

Post 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.
Þorvarður
Posts: 410
Joined: 2012-12-19 05:02:52

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

Post 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! :–)
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

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

Post 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!
withoutFeathers
Posts: 140
Joined: 2013-03-19 16:22:50

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

Post 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
Þorvarður
Posts: 410
Joined: 2012-12-19 05:02:52

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

Post 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
Post Reply