C-Command Software Forum

Search OCR'ed PDF from Applescript

Probably not really Eaglefiler question, but if it could use Eaglefiler’s indexing then even better.

I have an applescript that will set a record’s title based on what it sees in the file (mostly OCR’d PDF so they have text overlays). I tried ‘record’s contents contains “something”’ but it doesn’t like the script.

I tried grep or reading the file directly in applescript, but do not see the text that is visible and selectable in Eaglefile record viewer. Its probably encoded as something. Btw, Eaglefiler is able to find the text via its index.

What’s best way to do this ?

thanks,
bob

I’m seeing weird behavior with the contents property, as well. However, it works for me when I use this construction:

tell library document 1
    set _id to id of _record
    set _contents to contents of library record id _id
end tell

yep, that worked! Thanks again
bob

With EagleFiler 1.5 there is a new text content property, which should work when contents doesn’t.