[Resolved] Add "wait for result" to OCR command in smart rule?

When OCR’ing a document in a smart rule, the OCR process runs in the background (I assume). So, a subsequent action that relies on PDF having a text layer (like “Scan text” or “text contains”) might fail because the OCR process has not terminated when the action runs.

The scripting suite’s OCR command provides a waitingForReply parameter. I suggest adding something similar to the smart rule action. Eventually :wink:

That’s the job of the OCR & Continue action.

Of course you had thought of it. Thanks.

P.S: In both cases the smart rule actually waits for the completion of the OCR process. The only difference is that following actions either still use the original item (OCR action) or the created item (OCR & Continue). The same applies to e.g. Duplicate & Continue or Convert & Continue

So, when I set “move original to trash” in my OCR preferences, the following actions are performed on the document in the trash? That does explain what I saw (empty pages were not removed after OCR by my script).

This setting isn’t used by smart rules, it’s up to the smart rule to trash items or to use the right OCR action.

I don’t see any differences:

  • preferences set to “move to trash”
    • “OCR” in the smart rule does its job on the file and nothing appears in the trash. Nor do I get a new document, but the modification date of the original gets updated.
    • “OCR & Continue” in the smart rule does its job on the file and nothing appears in the trash. Nor do I get a new document, but the modification date of the original gets updated.
  • preferences “move to trash” turned off
    • same behavior as before.

I must admit that I OCRd PDFs that already had a text layer, but that shouldn’t make a difference, or should it?

A screenshot of the smart rule would of course be useful.

Here you go:

OCR > Apply doesn’t create a new document, the existing one is updated.