Searching DEVONthink using DEVONagent

I’m trying to create a plugin for DEVONagent that will allow it to search DEVONthink Pro Office using its web server functionality.

So far, although my DTPO search for “philosophy” turns up a large number of links (many of them plain text files), DEVONagent only sees the entries which are web pages and have an originating URL. That is, I get 47 hits in DTPO, but only 4 hits in DEVONagent. Also, double-clicking on the hits that DA does see causes it to visit the original URL, not the copy in DTPO.

Here is my plugin:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">
<plist version="1.0">
	<string>DEVONthink Pro Office</string>
	<string>DEVONthink Pro Office Plugin 1.0 ©2007 John Wiegley</string>
	<string>Searches your DEVONthink Pro Office.</string>
	<string>&lt;ol start=</string>

Note that I’m guessing this has to do with the way that DTPO’s server outputs the href links:

<a href="rands.philosophy.txt?id=584021&action=view" set="yes">rands.<span class="markup">philosophy</span>.txt</a>

Since it’s a server-relative URL without an HTML extension, perhaps DA is ignoring it. But since it is browsable, shouldn’t there be a way to get DA to show it as a hit?

Getting this to work would be a great way to add my DEVONthink database to my typical “Fast Scan” search set, letting me search against whatever I have archived there, since I tend not to use the DEVONagent archive much.

Thank you,

There are several issues. First, use c=1 and w=0 in the URL (no case searching for the contents). Set OffsetPerPage and ResultsPerPage to 50. Finally, remove LinksEnd/LinksStart and add LinksMatching & Operators:


Unfortunately this does still not really work - DEVONagent skips the RTF/RTFD/PDF links. A future release of DA and/or DTPO will improve the compatibility.