automatically OCR PDF files


I want DTPO to automatically OCR each new indexed or imported PDF file.

I have in DTPO a smart folder which »contains« all PDF files with word count equals to zero. Can I merge this folder with an OCR script?

Thanks in advance for your support! Kind regards, Friedrich

You could attach this script to a group and selecting (in split, column or 3-pane view) or opening the group will execute the script and OCR PDF documents if necessary:

on triggered(theGroup)
	tell application id "DNtp"
		set theRecords to children of theGroup
		repeat with theRecord in theRecords
			if type of theRecord is PDF document and word count of theRecord is 0 then
				convert image record theRecord without waiting for reply
				move record theRecord to (trash group of database of theRecord)
			end if
		end repeat
	end tell
end triggered

How do I attach the script to a group, i.e. to a smart/intelligent group?

It can be attached via the Info panel but this script supports only real groups but tests on its own whether the PDF documents have to be OCRed or not.