Auto-adding items into the corresponding inbox of a database

Hi there,
I am looking for means to add items (outside of the DT environment) directly in a specific inbox of a database. Any suggestions? (I guess this can be done solely by using scripts, right?)

Thanks in advance

For starters…
Scripts.
Folder Actions.
A utility like Hazel.
Drag and drop to the Sorter or Tools > Show Groups & Tags.

Thanks for the reply! Actually I am using Hazel for simple automatic tasks. I don’t have much clue about coding in Applescript/Shell. I heard there are already some user template codes in this forum.

Somethink like:

tell application id "com.devon-technologies.thinkpro2"
    set img_ib to get record at "/Inbox" in database "Business"
    import theFile to img_ib
end tell

A tutorial would be very helpful.

If you indeed have a database named “Business” open, that’s a functional bit of code. Is there an issue you are having with it?

On a side note, starting the tell block for DEVONthink is best written as:


tell application id "DNtp"

Hi Jim,
I found that code on the internet - and modified only the database name for my needs. Everything works good so far. I am using this code for my scanned and OCR’ed PDF documents via my ScanSnap. Unfortunately Preview (since Sierra) permits editing PDFs in the Global Inbox - I already discussed about that with the DT Support and they already know about this behaviour. The reason is, that the Global Inbox Database is located in the macOS system path environment - therefore Preview don’t allow to safe any subsequent data modification there, instead offering a copy of the file which has to be saved in another path.

Regarding the code, so you recommend to replace “com.devon-technologies.thinkpro2” with “DNtp”, right?

It will work either way, but it’s best to be in the habit of using application id “DNtp”. Cheers!

It is me again. After all the solution with Hazel has a major flaw:

After scanning has finished, the PDF is placed in the folder watched by Hazel. In the meantime the OCR process begins using SnapScan’s own super-fast “Searchable PDF Converter”, but the process can not be completed since Hazel has moved the unfinished PDF to Devonthink. I know that I can set up additional time rules in Hazel (“move the file after xx seconds/minutes”). This might work well for documents with few pages, but what about a stack of 30 pages in one session? This is not smart, so I don’t like it. Maybe the script needs some modifications in order to overcome this flaw?

Furthermore I thought about using the Devonthink add-on plugin in the ScanSnap Manager instead, but there are no settings available in order to customize the processing behaviour. Are there any modification options in the background?