Importing documents into and storing the resulting item link

I would like to import a large number of documents into DTPO through using an automated script.

The goal is to be able to store a reference to each documents in an external database using Devon’s item links. (This is so that one can click the link to bring up the document from within that database system.)


Is it possible to get DTPO to return the link to each imported document upon import so that the link can be automatically stored by the script?



Assuming you are familiar with AppleScript and DEVONthink’s AppleScript dictionary, you could have the following inside a loop that gets a document and creates a record in DEVONthink

set thisItem to import thisPathItem
set thisURL to the reference URL of thisItem

Your script would then write out “thisURL” to your other “database system” or to a file which could later be imported to that database.

Where “thisItem” is the new record that “import” creates; “thisPathItem” is the POSIX path to the item you are importing; and “thisURL” is a string that contains the reference URL (aka “item link”) of that newly created record.

The “import” command has several other optional parameters.