Question about Sequence PDF→ OCR (RTF)→ Plain Text with Smart Rule

Sonoma 14.7.5
DEVONthink 3.9.10

I often carry out the following sequence (working on a personal multilingual with translation text to speech action for my DEVONthink files):

  • start with a non readable PDF (images of text)
  • OCR to RTF
  • convert resulting RTF to Text (direct PDF to text does not give good results)
    Is there any way to make this sequence automatic, perhaps with a script or a smart rule?

I created the smart rule below but am hesitant to test (ie run) it:

  • I want to make sure that the rule will only apply to the selected file/item. If it applies to all PDFs in my database, it will be a disaster. What do I enter in “the following are true” to state that the rule applies to the selected file only.
  • I would like to confirm that the sequence of actions OCR→ Rich Text→ convert plain text is correct.
    thanks in advance for your time and help

I want to make sure that the rule will only apply to the selected file/item. If it applies to all PDFs in my database, it will be a disaster.

Of course it would apply to all of them, and in all your databases. Look at your Search in and criteria. You have essentially filtered nothing.

And smart rules don’t act on the selection by default. If you want to do that, you can create a properly filtered smart rule. You can then use Tools > Apply Rule on a matching selection of documents. You can also drag and drop documents onto the rule.

You could also use a batch process if this was a one-off process but it doesn’t sound like it is.

Here is a properly filtered and restricted smart group that would do what you’re looking for in DEVONthink 3…

1 Like

Smart rules do not process selected items usually but items that match the conditions after a certain event (e.g. On Import). A batch processing configuration of version 4 might be more useful here.

In addition, instead of the OCR action you have to use the OCR & Continue action so that the new item created by OCR is used by the following actions.

1 Like

DEVONthink 4…

:thinking:

1 Like

I shouldn’t reply before my first coffee :joy:

2 Likes

Haha! I shouldn’t reply at 2:00am as I had to double-check I hadn’t missed something :slight_smile:
But OCR & Continue is a good idea, just as a Data > OCR > Apply command is :wink:

Time for me to crash… :sleeping_face:

1 Like

Thank you very much @BLUEFROG and @cgrunenberg

And @BLUEFROG SOO SORRY to interrupt you while you were in the arms of Orpheus.

“In the arms of Morpheus” refers to being asleep, specifically in a dreamlike state. Orpheus, in Greek mythology, was a legendary musician and poet whose music was said to have the power to charm animals, plants, and even the gods themselves

I read the documentation, and it does not seem possible to save a batch process. Is this correct ?

when you are and have had breakfast, could you explain what Search in: Editor>Inbox exactly means / does? thank you

This requires version 4.

1 Like

… and nowadays, to the Matrix :slight_smile:

1 Like

That is how you target the location on which the smart rule acts. In my case, the Inbox of my Editor database.

And no worries! :slight_smile:

1 Like

So it’s not really only the selected file/item, it’s anything in that group.

To focus on the selected item, I was thinking of adding a keyword like “$selected^” in the item I want to run the smart rule on and have the smart rule trigger when “name contains $selected^”.

Does this make any sense ?

thank you

Smart rules aren’t made to work on selections, by default. See this blog post…

And don’t think about selections if you’re building smart rules
unless you are going to use the Tools > Apply Rule commands.

1 Like

Tools→ Apple Rules is very easy with a Keyboard Maestro macro. Just to be sure: it will apply only to the selection ?

Sorry to be persistent.

It will apply to matching files. This is easily tested on your setup.
It also underscores the importance of using specific criteria in smart rules.

1 Like

thanks very much

You’re welcome.

BTW, while we’re not advocating DEVONthink 4 for production, the Tools > Apply Rule commands filter from the selection and are only enabled when matching files are detected.

1 Like