OCR on PDF files attached to e-mails?

If I run a clean second user - than it says that the script is “false” after running it from the script editor…

And did it actually import anything? Do the selected emails contain PDF attachments and do you use the Pro or Server edition?

I have used the same database that contains 3 e-mails with PDF attachments.
DevonThink 3 Pro edition

In that case the only option is to debug the script on your own, e.g. by adding logging or displaying a dialog after each step.

Is there an option that I can upload the complete script so you can check ?
Because what I don’t understand is that if you have the exact same settings as me and it works for you and not on my Mac - I would say the script must have a failure ?

Actually I use exactly the same script from your post.

Might also be a different macOS setting or some 3rd-party app.

But what I don’t understand : if you already have extracted some e-mails with PDF, and you run the same again does it skip the ones you have already extracted ? When I run from the script editor I also get after running 2x the script, double.

So that’s why somehow I think you have a different script than I have…

The script doesn’t skip anything, the PDF attachments are always imported.

Thanks. Would be nice that I could run the script every now and than to extract new pdf’s from the email archive ( that is growing every time I sync with Outlook) and not having every pdf’s again imported in that group that already is there.

I feel because I have zero knowledge of scripts that it stops here for me.

I simple can’t understand why it doesn’t work on my system on a fresh 2020 iMac with Outlook and DEVONthink - all latest versions.

Are you running the script in Outlook or DEVONthink?

I am seeing no issue selecting an email in DEVONthink and running the script.

The email

The attached PDF extracted

Running directly from DevonThink

Is *.eml e-mail the same as E-mail message ?

Because in your screenshot I see attachment.eml and my e-mails are marked as “Email message”
Can that be the issue ?

Look at mine :

Yes, an .eml file is an email.

Can someone please send my the script that is working for you ?

As download ? Or per e-mail ?

Because I think maybe I am doing something wrong with copying the script from this forum and pasting it in script editor…

Extract Attachments from Email.scpt.zip (5.6 KB)

Thanks.

But as you already might have guessed… same issue.

So it only works when I run the script directly from the Script Editor.

For now I can live with that, but of course it’s very strange that I can’t find out what exactly is the issue…
Is it important from where I run the script ?

I have copied it to here :

The subfolder you put the script into here shouldn’t matter. As long as you can find it.

To run the script it should have full disk access - correct ?
Is it important that the “check mark” is on or not ?

Having Full Disk Access for DEVONthink is important indeed.
You should also receive automation requests when running certain operations that use AppleScript under-the-hood.

Where should I receive does automation requests ?

Hi @BLUEFROG I download your script it"s perfect…
I suggest you include in the the mail plug, in the implementation of DVTK…