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.