Stop DEVONthink Smart Rule from exiting rename process

Hey there, fellow Devonians,

I have a problem - I created a Smart Rule to rename my documents based on the text found in OCR. I’d want to continue working on my files while DEVONthink scans and renames.

But every time a document is finished it skips the editing process for a second and continues then.
So when I’m currently renaming a document it’s like if I press enter and enter again.
(editing stops and then continues) But then all Text is selected.
So it often happens that I delete the whole title accidentally…

First I thought it’s the “Cancel”-Action at the end of the smart rule, but even after deleting it I have no luck :sob:

:frowning: Anyone has an idea?

May be you could post the rule?

And: what means “a document is finished”? “It skips the editing process”? Is “it” the rule or DT? Which editing process? What does “skip” mean here? What do you mean by “pressing enter”? Is editing the same as renaming? I’m confused.

Imagine you edit the name of a document. You see the grey frame around it.
Meanwhile DEVONthink performs OCR on several documents (you see the progress bar in the lower left corner). Whenever a document finishes and DEVONthink jumps to the next one it behaves like you would press Enter and just press Enter again.
So editing mode stops and then continues.
It’s difficult to explain though…
I made a gif for you:
CleanShot 2020-07-16 at 18.53.25

This is the rule:
grafik

Why are you dropping files in a location to OCR then changing the names while they’re queued up??

Not THE NAMES of the documents in the QUEUE of course, but names of OTHER documents. If you watch close enough you’ll see that I haven’t selected the document for the queue.

You have set the order in the file list to date created descending, if I get it right.

So when a document has gone through all steps of the smart rule it gets a new create date and therefore moves to the top of the file list. After that the cursor position of the other file you were renaming manually is gone and instead of that the whole file name is selected. When you continue editing it without noticing the selection you overwrite it.

I have tried to reproduce what you did and can confirm this behaviour. It has nothing to do with OCR, it’s just the movement of the manually edited item in the list that causes the selection of its complete name.

A question you’d most certainly don’t want to hear:

You want to. But do you have to? Can’t you just wait a moment? Or are we talking about a huge number of documents to OCR so processing them would take significantly longer than just a moment?

Or another approach: Can you replace the manual renaming by another smart rule? So DEVONthink would handle all items in the background and you would not have to bother?

Hi suavito,
I see what you’re trying here :wink:
It’s the “It’s not a bug, it’s a feature” Anti-Overworking-feature in this case :rofl:

No, joke aside:
Besides I hate having to wait I had a batch of 200 Documents - I certainly want to CONTINUE the topic I’m working on. And if I could let DEVONthink handle that with a smart rule I would CERAINLY not do it manually :laughing:

And I have to admit that the files don’t get a new date.
And they are sorted by name - of course the same thing occurs here.
But I also tried working on another folder, and that ALSO did not work - and this is definitely an issue. I can understand that if something pulls and pushes documents in one folder that it can be an issue (although there are sever apps out there who can do folder operations on macOS without interrupting a rename procedure) but what has another folder in another database to do with it?

Why are you targeting all databases?
Targeting a more specific location is usually a safer option.

Are you renaming in the smart rule’s results?

PS: Including characters like euro symbols, etc. is a less compliant nomenclature. Ideally only spaces, hyphens, underscores, and periods are used in filenames.

Because I have set the trigger to manually So I also select the files manually and drag-n-drop them onto the rule.

I know the issues with special characters, for my use case they work well :slight_smile:
Also it is much easier to see the price if it ends with € instead of EUR

Not at all. In my opinion that and the similar “You’re holding it wrong!” are insults and I don’t want to insult anybody.

But I know from my own experience that sometimes it does help when you got stuck if someone points you into a different direction. Not it this case, unfortunately.

What still baffles me is that there is no way to automate the renaming of all files even for someone as regex savvy as you.

1 Like

#nohate, man :slight_smile:
I appreciate you took your time to write a fairly long comment and I believe that sometimes this helps, but let me give you another example: My iMac has a faulty graphics cart that overheats over time (even with only one application like word / mail / browser open. Apple told be to “just wait and do something else until it cools down”. Unfortunately my customers don’t pay me for waiting :smiley: - so I wasn’t very happy about the answer (I see the difference here, you’re not an DEVONthink official, and the iMac thing is a way bigger problem)

Thanks for the regex-savvy I really learnt it today :sweat_smile: no joke. It’s fairly easy once you get behind the curtains. (I spent 1 hour on this site https://regexone.com/lesson/introduction_abcs)

There two three main reasons I need to rename:

  1. The OCR failed (faulty, crumbled piece of paper or chinese invoice or faded thermopaper)
  2. Categorizing for companies I have only one or two documents from

I can’t see a way to come over this - even for the regex savviest man/women out there :frowning:

AND I miss an IFTT (if…else) function in the rules set (or have I overseen something?)

No IF—THEN—ELSE, no CASE in smart rules. But it is possible to create a more complex AND/OR condition structure. As you probably know already.

The next step would be a script. If you don’t know Apple Script (JavaScript works too) maybe you could learn it tomorrow. Wait, even better: You could learn it tomorrow while you’re waiting for the OCR to finish.

No, I am not making fun of you. I would just like to upgrade from rating you as regex savvy to very general computer savvy (if that is still proper or at least proper-ish English).

It’s way harder to learn Apple Script or Java Script than regex :laughing:
Still - it does not matter which way we hold it - it does not resolve the root issue here.

Thanks for the explanation. So basically,

  • you’re OCR’ing files and changing their names afterwards with a smart rule
  • while this rule runs, you’re also changing manually (“editing”) the names of other files
  • whenever the file is OCR’ed or the rule has finished, the window you’re editing in loses focus.

This behavior is, I think, not necessarily a feature. There’s no point that the focus should be moved to the OCR window nor from the window you’re working in. OCR is just some background process that shouldn’t bother your work. So maybe the developers could/would do something about it. And just maybe, changing the sort order in your window might mitigate the effects, but I’m not sure about that.

As to the € sign in the filename: I suggest moving the amount to a user meta data field. That makes it easier to show in list views, e.g., because you can see it in its own column, not embedded somewhere in a file name. At least that’s what I do. That permits me to generate a table document with date, name of document and amount for one year - nice to have for tax purposes.

On a final note: You might be better off using KeyboardMaestro (for renaming) together with PDFPen (for OCR) before importing PDFs into DT. That’s what I do with some of my files, notabene receipts from Deutsche Telekom and bank account statements. KM still offers more file renaming possibilites and RegEx support. In my opinion

AppleScript is slow & limited but beautiful :slight_smile:

1 Like

As always, beauty lies in the eye of the beholder :slight_smile:

Yes :smiley: That’s what I think too :beers:! Thanks for the summary (I’d highlight that If we were at Medium :laughing:)

Yes I see your point, but the files have to go to several places and in my experience (as there seems to be no real metadata standard for PDFs or nobody cares about it) the tags and meta gets lost along the way - so the filename is still the most robust way I guess (unfortunately) But I think I regex or try to script that. As my filenames holds all of the necessary tax information in exact same order it should be pretty easy to do.

Thanks for that information - I will surely give that one a try :star_struck:

The next release will fix this.

1 Like

AMAZING!!! Thank you so much!