Question: How can I select multiple pieces of text from search?

I’m working on a project that requires a lot of repetitive formatting.
Lots of pieces of text all need to have the same style applied to them - they are scattered throughout the document.

I’m trying to find a way to search the phrase “(or)” and apply a heading style to all text that matches those parameters. Does anyone know of a way to do this?

Thank you!

I’m pretty sure you cannot. Matches are highlighted when you do a search, but they’re not selected. If they already had a style, you could select everything matching that style, but searching for a word doesn’t work that way. I wish it did. Recommended workflow is to make every heading a one-line document, with an appropriate section type. Then you’d be golden.

If you select all the (relevant) documents and have Scrivenings Mode enabled, all of the text of all the docs will be in the editor pane. Doing a regular Find for ‘(or)’ will highlight it throughout. Now, using Find Again (cmd-G) you can walk through them having each selected in turn, and that way apply a style to each, if that is what you need to do. With the style panel open or a temporary shortcut (e.g. cmd-opt-Z) set for that style, you could walk through a lot of instances pretty quick (cmd-G, cmd-opt-Z, repeat). If the style you are applying is a paragraph style, it will apply to the whole paragraph, even though only the string is selected — which I suspect is what you are wanting.

1 Like

From that, I could automate the whole thing in Keyboard Maestro except for one thing: I don’t see how to stop the infinite loop.

Sometimes you just have to do things. ‘S life.

This is a fantastic solution. Thank you so much!