Smart Rule: OCR and rename on pdf import

I’m trying to use a Smart Rule to OCR pdfs on importing/moving them into the database, then scanning the text and renaming the pdf. The issue is that the smart rule doesn’t seem to move beyond the OCR.

Searching similar topics, I figure it could be related to this:

Curiously, that’s not true for me. DT 3.5.1 creates the same result, i.e. keeps the original file and creates a new OCRed version, whether I choose OCR Apply or OCR to Searchable PDF.

Could you pls post a screenshot of your smart rule?

Screen Shot 2020-07-11 at 10.10.25
If I delete the OCR Apply line and apply the rule to a PDF+Text document it works as expected.

I’m supposed to be doing other things, so I’ve just set up a rule like that, created a document without a text layer, set the scope to “databases” and tried it out. The following rule works for me:

OCR Apply does not create a new file for me - it does exactly what the quotes attributed to Jim and Criss in your post suggest it should do.

I’m sorry, that’s probably not very helpful other than suggesting that this may be a problem attributable to an exception rather than a bug affecting everybody. That might mean that opening a support ticket is the way to go.

When you trigger the smart rule by moving a document from the global inbox to a database, do you see the info area (bottom left of the DT window) display a message suggesting that OCR is being performed?

1 Like

Why are you using the On Moving into Database event trigger? That’s used for moving indexed files into a database.

This is explained in Help > Documentation > Appendix > Smart Rule Events and Actions

1 Like

Whilst that may be true (alright, it IS true :D), the rule still works for me (and I haven’t got any indexed items - it just worked as I expected on moving from one database to another) but not for the OP. I was wondering whether the rule was actually being triggered (which was why I asked whether the info area shows anything), but the fact that the rule works when “OCR Apply” is removed suggests it is being correctly triggered, and that something is wrong with the OPs “OCR Apply” - or no?

Thanks both of you for your help. You helped me identify some knobs to turn for trial and error which eventually helped me find the culprit. Another smart rule got in the way that looked for incoming files to OCR them!

Well, that’s very pleasing :slight_smile: well done on catching the culprit!

(I only recently noticed that whilst smart rules run in the order they are listed in, they effectively still run concurrently rather than in strict succession - meaning e.g. that one of my smart rules using a script sometimes triggers but then can’t find the document it’s supposed to act on, because a further (and apparently faster) smart rule has moved it to another destination :crazy_face:)

1 Like

Oh the joys of asynchronous processing! Even more joyful if the usual tools like callbacks or promises don’t exist.

Glad to hear it and be of help :slight_smile: