Replace All with formatting

I would love to be able to do a “replace all” that includes formatting (italics, or text color, for example).

What is it you are trying to accomplish? If you’re basically just looking for a way to strip out formatting, would Paste and Match Style do the trick?

I want to be able to color every instance of a particular word a certain color. In my case, it’s to look for overuse of passive voice. It helps if I can see how thick “had” is in a paragraph, or on a page.

My workaround is to copy a blue “had” and then use Find and then CTRL-V to paste in the colored one. It would save me some carpal tunnel fatigue if I could do it with Replace All instead.

I could see other uses for this too, like if you wanted to italicize all the uses of “bon jour,” for instance. Or if you’re writing House of Leaves and want to color every instance of Minotaur.

Sure, you can go through one at a time with Find and do them all manually, but it would be nice not to have to.

If this is something that you could see being useful on a temporary basis, try the Project Search feature. If you search for “had”, then all instances of “had” will be highlighted (more accurate if you use the Whole Word option) as you browse through the files. Additionally, if you leave “Typing clears search highlights” disabled in the Editor preferences pane, then you can even work around these highlights. Since you’re looking for these overused words anyway, narrowing down your list to the documents that even have the words to begin with is something you probably would want anyway.

Some people even keep a search collection of overused words. You can use the “Any Word” search mode and supply a whole list of things you’d like to watch out for. They will all be highlighted when using this collection.

That sounds like it’s worth exploring. Thanks. I think it will work for some of the words I’m looking out for, but not all.

Is there any way to make it case sensitive?
Or to search for words that end in “ly” (or whatever). I really like that function of the Find.

eta - I just spotted the Case Sensitive line in the drop down.

Yes, at the very bottom of the “magnifying glass” menu, there is a “Case Sensitive” option.

You can search for words ending in ‘ly’ with regular expressions (in 10.7+). Just switch the Operator to “RegEx” and then type in ly\b. The special \b search command means “word boundary”, and is thus more flexible than using a space, as boundaries can also be defined as various forms of punctuation, too.

Thanks very much!

Is there a way to do a replace all with super/subscripts? In my document I have 1st, 2nd, 3rd, etc. written out in many instances. I’m trying to format the “st”, “nd”, “rd” to super scripts. Scrivener does this automatically, but when a pages document is imported the “st”’ “nd” etc are not converted.

This would also be helpful for a science paper. Ex: H20 to H "subscript #2, then 0.