One can do what I think the OP wants, all words capitalized, using template mode in search & replace. (Personally I think capitalizing every word is wrong, but the OP is in charge of the OP's library.)
If the titles don't contain non-alphabetic characters other than space then this GPM template does the job.
Code:
program:
new_title = list_re_group($title, ' ', '.', '(.*)', 'program: capitalize($)')
With this template, "a witch in the time of the lords" becomes "A Witch In The Time Of The Lords".
If the titles do contain non-alphabetic characters such as colons and you want strings like foo:bar to become Foo:Bar then this python template gets close.
Code:
python:
def evaluate(book, context):
import re
nt = []
for w in re.split(r'([() :-]+)', book.get('title')):
nt.append(w.capitalize())
return ''.join(nt)
You must list the characters on line 5 that can precede words to be capitalized. This example uses r'([() :-]+)', parens, space, colon, dash. The problem children are quotes. Sometimes one wants the capitalization after the quote (quoted words in titles, as in "What Does "Foobar" Mean") and sometimes not (possessives, as in "John's Great Escape").
The first template probably gets most of the way there. I wouldn't try to get too fancy, instead correcting any "mistakes" by hand.
The search/replace looks like this, with the desired template in the template box.