I use a set of three-letter capitalized prefixes for my DEVONthink files as system of file taxonomy (e.g., DOC_ - document ; ART_ - article ; NTS_ - notes, etc.) for certain crucial files.
I have even set a label in my DEVONthink that I manually apply to files that lack any of my prefixes so that my file taxonomy system works, and I can quickly spot and identify my files.
Is there a way to create a script to that can automatically apply my label to files within certain groups that lack one of the three-letter capitalized prefixes for my files?
The thing is, I often use these prefixes — for many files — but sometimes I’ll jot down a quick, informal document without a prefix, and that’s ok. Although maybe my right brain would disagree!
Right. So, let’s say I have article files in a Group that lack the ART_ prefix. Could I set up a Smart Rule that would automatically label these files?
If that’s possible, perhaps could apply such a Smart Rule to a set of Groups in which I reliably have files with my prefix taxonomy – thereby automatically labeling files that lack the three-letter capitalized prefixes (again, if possible).
I take your point. I’m basically seeing if there’s a way to create automation based on the absence of something, which is I guess the challenge. Ok, so about about this…
Could I set up automation – script or Smart Rule – in which I say, if files don’t have the following (prefixes) …
With regex you should be able to search for such names (strings) or exclude them. If the AI does not do this correctly, someone else (human) certainly does. Unfortunately, I don’t know whether this is enough to automate it.
A negative look-behind regular expression might do the trick. Right now, I can’t tell you more because I have only my iPhone with me. But the Net should know what there’s to know about it. Something like (@@@(ART|DOC|MMO)_).*
Where (@@@ is a placeholder for negative lock-behind.
But as @DTLow said, you’d have to use that in a script setting the label only for file matching the RE.
As @DTLow asked about, I further the commentary… No. …unless these documents are all segregated in their own groups or you provide some matching criteria. How would the automation know what label to apply without you explicitly telling it by providing something to say This is a Note. This is a document., etc.? Imagine you send me the group of your documents and said, “Jim, please label these documents. I’ll be back in an hour to pick them up.”, then left. You’d come back to either something done wrong or nothing done at all, because you gave me no instructions on how to determine what label to apply.
Are you using the Pro version of DEVONthink? If so, I’d suggest you consider removing the prefix from the filename and moving it to a custom metadata field called, for example, “type”.
This has two main advantages: A Smart Folder or Smart Rule could use the simple condition Type Is "" to display/apply to items without a taxonomy indicator.
And when you link to a file or quote from a file, you will only see the actual filename, not “DOC_filename”.
That’s how I would do it, but like I said, it’s just a suggestion.