Although the tone of some of the contributors to this thread is both unfortunate and, IMHO, to be deplored there is some good come out of it, this little hint from Korm is one example. may I make a suggestion that one of the more knowledgeable members write a sticky on searching within the application, if, that is, they have the time and inclination to do so? I would but I absolutely do not have the knowledge but would very much value such a sticky.
Finally may I say that I believe that the vast majority of members are very grateful to those expert contributors who unfailingly give good, solid advice and I thank them for their patience.
From what I can tell, no changes have been made within the app to support multi-file search-and-replace, so I figured Iâd share the solution I ended up using in case it helps someone else down the line.
While @kormâs script is much appreciated, the warnings gave me pause, so I sought something a little more robust and familiar. Enter VS Code.
I havenât spent enough time with this to be 100% sure that I didnât bork something. So far so good, though.
Use Case
I have a few thousand markdown files exported from Ulysses representing about 5 years of world-building notes for a future fiction book series. About two years in, I changed the name of a major character, but didnât bother to go back and fix it because, well, Ulysses also doesnât have a global search-and-replace.
Iâd already imported all the files into DT by way of discovering whether itâs got what I need to help me rediscover my own thoughts (answer: probably!). Iâd also completed a major tagging exercise designed to help me track the source of each note as I begin to slice and dice and rearrange them. Only mentioning this because, if Iâd known that global search-and-replace wasnât going to be available in-app, Iâd probably have reversed the order, fixing updating the characterâs name in the original markdown files before importing into DT.
The Solution
Prep
File > Export > Database ArchiveâŠ#safetyfirst!
Smart Group to collect all files containing the old character name
This allowed me to change ever occurrence of âAdrianâ to âAdrimâ in the file list.
Update file contents
Right-click on the database and select Show in Finder
Right-click on the revealed .dtBase2 file > Open With > OtherâŠ
Select Visual Studio Code
Perform a global replacement in VS Code, being careful to use whole-word search and carefully inspecting the search results before performing the bulk replacement. Caveat lector: this is where itâs possible to do some real damage if you donât know what youâre doing!
Once VS Code had saved all the file changes, they appeared instantly in DEVONThink! #problemsolved
Needless to say, this should work with any other text editor, be it a command-line tool, Atom/Sublime, BBEditâŠwhatever. Itâs rather wonderful that DTâs âdatabaseâ is just a file bundle rather than in some inscrutable binary, thus enabling this kind of back-door power fix.