Can I write to DT columns or tags with Applescript?


I am interested in developing scripts already out there and writing my own scripts as well to get data into DEVONthink from other applications, and I am wondering if it is possible to write to DEVONthink columns (such as Author, Title, etc) as well as DEVONthink Tags from the script.

So, say I have a series of notes in a Word document. I would want the script to do the following:

  1. Create an RTF file for every note/paragraph
  2. Add these notes to a group in DT
  3. Add tags for each note in DT (the tags would be specified in the Word Document after each note, say comma separated)
  4. Populate columns in DT such as author and title with the Author and Title specified in the Word document

Would it be possible to use Applescript to interact with DT in this way?



It’s possible to script tags but it’s not yet possible to script document properties like author or to add/define your own properties.

Thanks. Do you have any tips on scripting tag writing?

Specifically, if I had a series of notes in say Microsoft Word and after each note entered DT tags in a specific format, such as *tag1 *tag2 etc, then wrote a script to save all notes as separate RTF files in DT with tags attached, how would I go about writing the DT/tag part of the script?

You could set the “tags” property, see for example ~/Library/Application Support/DEVONthink Pro 2/Scripts/Comments/Convert Comments to Tags.scpt

OK, thanks.

I’ve been led to believe that the Spotlight Comment property can be written to via Applescript. Is this an exception to the rule?

If I could also put in a vote for opening up other document properties to scripting…

Yes, comments can be scripted as that’s not a property of the document (e.g. PDF or RTF(D)) but a system-wide file property and therefore can be handled without having to read/write complete documents.