Global Find and Replace

If there is a way in DTP to search for a given string across all the documents in a database and replace it with another given string, it is the most esoteric and opaque feature I believe I have encountered in any program and seems to be entirely absent from documentation.

I have searched every way I know in the forum to find reference to such functionality and have given up and posted here.

I had expected this to be a primary feature, yet I can find no way to accomplish it. Is there a way?

Denriddy

This feature doesn’t make much sense in our application since not all document types that it can import are guaranteed to editable.

But you could write an AppleScript where it finds all documents that are plain or rich text and that are not locked or read-only and for those replace a given string. However, it won’t be very fast depending on the size of your database. So you could improve it by first performing a search, then filter out these document types on the results and replicate these into a group, then run the first script on the contents of this group and remove the group. This illustrates that it is not a trivial operation…

Perhaps I should clarify my original question. I wrote that what I was seeking was a way:

“…to search for a given string…”

Although it was heavily implied, I failed to make it expressly clear that by string I meant a text string.

“…across all the documents in a database…”

Although it was heavily implied in the sentence, I failed to make it expressly clear that by “all the documents in a database” I meant those documents with text strings that reasonably could be searched, looking for exactly such uniquely identifiable text strings.

“…and replace it with another given string…”

Although it was heavily implied at every step, I failed to make it expressly clear that I only would want to replace a text string in an editable document with another text string.

If DEVONthink didn’t already have inherent in it the recognition of different file types, I wouldn’t have wasted anyone’s time with the question.

Given that it does, it makes infinite sense to have the global search and replace functionality for those document types to which such functionality would apply; it makes no sense whatsoever to have it perform operations on document types to which it would not apply.

Hoping that this amendment has reformed the shortcomings in my inquiry as it originally was posed—although the fundamental question has not changed one whit—I take it from the following advice that the answer is “no, there is no global search and replace for documents in which such functionality would be appropriate, useful, and infinitely sensible.”

I’m looking for an application that does what I need done quickly and efficiently—not a programming opportunity. I have enough careers without starting another.

Perhaps I shouldn’t mention the irony in apparently being told that this can programmed by users (using AppleScript), but cannot be programmed into DEVONthink by the developers.

Thanks for the information.

Denriddy

Annard’s response was accurate and was meant to be helpful.

As to a ‘simple’ routine that would let someone find and replace text across the documents in my database, that’s a terrible idea.

I’ve got tens of thousands of documents, more of them RTF than any other file type.

Imagine the chaos if one could search and replace text at will across an entire database. My collection contains legal documents, scientific articles and so on whose integrity could be compromised by database-wide search and replace.

I couldn’t agree more: in the hands of an idiot, it could be an utter disaster.

Will you join me in asking Annard to remove his advice, above, of doing it with Applescript, and to remove from DTP even the capability of doing it with Applescript?

We may save an idiot from destroying his database today.

Denriddy

If you often need a Global Replace command, perhaps DT is not the best tool for the job?

My database consists of a huge number of mostly RTF and PDF documents, for which a Global Replace command would spell unmitigated disaster. I don’t speak for DT, but it seems to me that the program is really designed to deal with files which, once created/imported, remain more or less static after that. Its editing capabilities are primitive compared to dedicated writing programs.

Scrivener, in contrast, is designed for writing and has an excellent project-wide replace function. I’ve found that DT and Scrivener complement each other very well.

Katherine

No, I support Annard’s comments. Under very special circumstances (certainly not for the databases most users create) I can conceive of the utility of scripting the ability to modify text documents.

But that should be complicated enough to keep the casual idiot from screwing up his database. And it is. An idiot who wishes to change the text of his reference collections (perhaps Shakespeare sonnets) – perhaps randomly? – will need determination and some knowledge of AppleScript. Who knows. Perhaps the results would be interesting. :slight_smile:

DT Pro provides a number of tools for power users. Fortunately, most power users seem to know what they are doing.

I’m glad to see the progress you’re making, but discussing “scripting” as an approach to global search and replace in relation to DEVONthink is pointless, since anyone who wants to do such “Applescripting” to search and replace text in a collection of documents doesn’t need DEVONthink in the least.

Why don’t you discuss it in a nice Applescript forum?

The omission of global search and replace, though, in any program such as DEVONthink that purports to provide a user with managment of large collections of text documents is a gross and glaring omission, and always will be. It was the same with FileMaker Pro. The developers, in their wisdom, and to their credit, finally provided it.

Just because you, personally, don’t need or want such capability doesn’t affect in the slightest the valid need for such capability in a vast variety of uses.

Denriddy

Comment from the peanut gallery: sometimes there is a direct ratio between the number of messages posted and the arrogance of the messenger’s tone. I admire the folks at DT for the patience and generosity they display at all times.

This is the first time I’ve seen this suggestion or request in the forum, which would leave me to believe it’s not exactly a feature in high demand.

Just because you personally need or want such capability doesn’t affect in the slightest the fact that it seems to be an obscure feature request, which can actually be implemented by the user using the tools provided in the software.

I’d also agree with Howarth on the admiration for the DevonThink posters. I’ve lurked in the forums for a long time, and these have been the most condescending replies to attempts to help that I’ve seen.

Yes, I was trying to help, and to get help in return, and yes, I did get these insufferably condescending replies:

I’m willing to continue returning it in kind as long as it keeps coming, while also attempting to discuss the actual issue rationally with anyone who can discuss the topic itself without descending into amateur forum-post criticism—which surely must be the lowest form of literary criticism one could aspire to.

Meanwhile…

Actually, there is one other request for it that I ran across in this forum, posted in conjunction with a request for a way to globally change document titles. The global string search & replace part was ignored, though some kind of workaround was suggested for the document title issue.

Furthermore, I’ve been in marketing for over 25 years, and, just personally (and professionally), I never would allow any client of mine to rely on such data as “absence of requests in web forum.”

I’d love, though, to see an actual survey of users and, especially, of potential end users asking whether such capability would be of value and use. That would supply valid, useful marketing information in relation to the value of such functionality in a document management program.

Denriddy

Dinriddy, the responses you received were intended to be helpful, and to gently point out to you that your preconception that a database should be easily changed by a “blind” operation such as search and replace would be a very bad idea.

Those responses were not “insufferably condescending”. They were honest and without attitude.

Do you understand why simple search and replace across many thousands of documents would be a dangerous design element rather than a feature?

Sir, no one has condescended to you at all. You seem to have a massive chip on your shoulder and it comes out in demanding, hostile, impatient tones. This is a public forum and you ought to make your remarks civil. You may know much about marketing, but you are addressing a large group of people with all sorts of expertise. I’m a professional literary critic with 40 years of publications, and when I say that your tone is arrogant, that judgement is not one by an amateur. By all means, continue to make your case, but don’t act as though you are in combat with a bunch of enemies or nincompoops.

Not at all. There are far more “dangerous,” potentially destructive operations built right into the program already, even more provided in the Applescript menu. I would expect you know these already, even while mounting and persisting with this meritless argument, but if you don’t, I will list them for you.

Denriddy

In that case, I am indeed honored to have been declared arrogant by a professional in the field of arrogance.

Denriddy

Oh well, now you’re just being childish. Do you approach marketing in this fashion? I conclude that you’re just trolling for trouble. I am all through with this thread.

My comments relate to Global Find, only, and I can certainly see many valid needs for the Replace function, say when a Government Department changes it’s name, yet again.

Very late to this discussion, which probably makes it pointless to post, but I am here after the stunning realisation dawned, after this morning’s and previous weeks of struggling up the leaning curve of DtPO, that my anticipation of being able to pour my groaning stacks of documents into my very expensive (for me) ScanSnap then into DtPO, and then be able to search on them for any trigger-word or conditional phrase, and do that globally (as I have done in iData since it was QuickDex, from 1985 on) is not possible.

I am shattered by this discovery. That, after nearly a year of pre-purchase research, expenditure and bafflement has passed, I have only now discovered that the very easy-to-use Paperless only saves images, and can only search on related personal meta-data that one enters for that image, and that the complex and expensive DEVONthink Pro Office, while able to OCR and save all of a document’s text with the raw image, is none-the-less unable to search it’s databases of that text, to me the main purpose of it’s existence.

Where to go from here? Probably to the nearest pub/bar to get spastic, to try to forget this waste of money & time.

The narrative is unfortunate but …

is absolutely not the case. DEVONthink will search text content within a single database, across databases, and within single documents. Search scopes can include numerous elements: the text content of PDFs, plain text and RTF documents, and many other doc types; tags and document metadata; and many other fields. (Just look at the capabilities of Tools > Search or examine the options available with Smart Groups.)

How are you searching? In the toolbar search box? In Tools > Search? (BTW, If you open a Find box using command-f, then the scope of that is limited to the currently selected document, not the database(s)).

DEVONthink’s search capabilities are very powerful. Please provide more info as to what you are doing that doesn’t work.

The original OP did not complain that DEVONthink is unable to search for a text string across all open databases, The complaint was that DEVONthink did not afford the opportunity to replace a found text string in all documents – which, in my opinion, would be a potentially destructive and undesirable operation for most users, who may have tens of thousands of documents, some of which may be legal or financial records whose alteration might have consequences.

I always use the full Search window, which not only makes it possible to search across all open databases, but provides potentially useful features not available in the Toolbar query field.