Import a PDF using Applescript *without* OCR

I am working on a script that imports PDF files into DT3 and keeps the resulting document in PDF format. It works well if the PDF already contains searchable text, but if it doesn’t then DT imports the PDF as a formatted note, with pages automatically converted to images and all text OCR’d. I would like to disable this automatic conversion but the API does not expose a parameter for doing so. The command I am executing is:

import [path to pdf] name [doc name] to [target group]

Adding the argument type PDF throws an error.

Setting “Convert Incoming Scans” to “No Action” in the DT3 “OCR” preferences has no effect.

Any help is appreciated.

I would not expect the import command to change the format of the item being imported (and the definition of a type in this context is described as obsolete in the script dictionary). Is it possible you have a smart rule acting on PDFs with no text layer?

I would not have expected that also. I am running this on a clean install of DT3, and I see only the default smart rules (Reminders, Filter Duplicates, and Bates Numbering) in the sidebar.

Also, when I manually drag the same PDF into DT3 it preserves the format.

Can you post your complete script, please? I will see if I can reproduce what you are seeing.

In the process of simplifying the script so I could send to you I found an error in a conditional statement. Problem solved. (One should always build a complete set of test cases.)
Thank you… I really appreciate the help.

1 Like