Smart rules are blocked while either a smart rule (e.g. due to OCR) or a script is still performed. Maybe Hazel tries to import the next file while this is still the case? To work around this and to simplify the setup, there are at least two options:
Use either Hazel or smart rules (e.g. a script in Hazel could perform all necessary actions)
Index the folder ~/Downloads/DMS WorkDir/Nach OCR/. In this case Hazel would simply move the original files to this folder, a smart rule in DEVONthink will monitor & process files added to this indexed group.
I second this. Hazel watches a folder and acts if something arrives there. You can do the exact same thing in DT by indexing this folder and having a smart rule act on it: If it needs OCR, OCR it and move it to “Nach OCR”. If it doesn’t need OCR, move it to the same group at once. You could do that with a single smart rule that looks for the condition “type is PDF/PS” and then runs a script which
checks if the plain text attribute of the record contains anything
if so, runs OCR on the record
and then moves the record (which either was OCR’d before or is now) to the relevant group
I was thinking about: What happens with the files that are OCR’d already? If you check for OCR in the script, one smart rule suffices and the script does all the work (i.e. decide if OCR is necessary). If you use a condition in the smart rule (i.e. Word Count is 0), one needs at least two rules: one for files to be OCR’d and one for the rest.
I would like to run the rule when a document is created in the directory and not depending on the tag.
Just what do I choose? I’ve already tried a few, but doesn’t work immediately as soon as a document is created in the directory.
But what you describe is still a two step procedure. Why do you even involve Hazel? It only sets a tag which you then remove in DT anyway (at least when you do OCR. I wonder what happens to this tag when you don’t OCR the file because word count is greater 0). Why not have DT watch the relevant folder (i.e. index it) and have it do what you need it to do?
After you described your process, I tried to set up something similar. Now I know why you’re kind of frustrated
Here’s what I decided to do:
Scan to a NAS folder
Have Hazel watch it
Have Hazel copy all files arriving there to DT’s global inbox (~/Library/Application Support/DEVONthink 3/Inbox)
Use a smart rule in DT which monitors the Inbox and subjects all arriving PDF documents with word count < 1 to OCR
This is of course different from what you do in that
I do not mix all kind of documents in the same folder watched by Hazel
I do not move the OCR’d file to a special OCR folder
The first is a matter of taste (and necessity, since I do not have anything else but PDFs coming from my scanner - not touching Microsoft documents with a ten foot pole The second … well, if you only want to use the document date for naming purposes, DT should be able to do that itself. I don’t really care for automation there, because I have only a few documents per week arriving, so I can do that manually.
If you really manage to convert 10000 pages to OCRd PDFs without manual intervention: congrats. Depending on the document quality and the date format (I just saw something like “1 Dezember 2020” and also “Im November 2020”), you might want to adjust your date-finding function in Hazel
Good. Please note that in my setup I didn’t move the files back into the filesystem.
On a related note
You could also access them from other devices (provided they’re from Apple if you stored (i.e. imported) your documents in DT itself. That’s what I do, using my NAS only for synching and (now) intermediate scan store. It’s of course a matter of taste, I just find it more convenient to have a similar view on the documents from all devices and not having to start a VPN each time I want to see something.
That is of course also a possibility.
Since I only use Apple devices and often have to access the documents via iPhone while on the move, DT on the iPhone is out of the question because I (if I have interpreted the documentation correctly) cannot and do not want use the mass of documents via iCloud Sync .
Which is not necessary. If you use your mobile devices only for reading documents (i.e. don’t enter new ones or change existing ones on your iPhone/iPad), you could use Bonjour syncing while not on the move. It’s described in the documentation, I think
Bonjour is reportedly fast and reliable. Turn it on on your desktop and set the mobile devices to use Bonjour (do not turn Bonjour on on them, though!).
Again: a matter of taste. I’m just mentioning possibilites.
My primary concern is external access.
And here I currently don’t see an option with the DT mobil app.
I avoid backing up documents on a cloud outside the EU (with regard to data protection) and the DT Mobile app currently offers no other option.
What is the connection between “external access” and “backup”? I described how to keep DT on iPhone and desktop in sync without the need for a cloud provider or even the internet: local sync via Bonjour.
If you don’t want your iPhone data backed up in iCloud, turn it off. That’s completely unrelated to syncing.
A “backup” of my documents (I hope I understand that correctly on my iPhone (approx. 1.5 Gb) should be a solution?
Quite apart from the fact that I don’t consider redundant data storage to be optimal, the amount of data is a bit much.
This will take hours, especially with the 1st “backup”.
Why do you read “backup” when I say “sync”? I suggest you read up on that topic (or better: both, namely sync and backup) in the documentation or here in the forum. There’s no requirement to download all documents to the iPhone.
BTW: Given the current frenzy with selfies, movies etc., I don’t think that 1,5 GByte is a relevant amount of data on a current iPhone.
thanks anyway for the excellent help.
I will look again at the topic in the documentation to what extent I should reconsider my reasons for storing files on the NAS.
if I should need further help with this, then I will open a new thread (are a bit off-topic here … ;-)))