Using DT to inform DA searches

Here is the background: I am a digital humanist who has a library/database of previously collected articles and sources relating to my research.

Question: Is it possible to use a database in DT to create a set of criteria or search parameters that would then be used in DA to pull similar resources from the web?

My preference would be for automation rather than using DT to find keywords and building my own search queries in DA. Of course, I could do that, but I wonder if there is a mechanism that might aid me.

Any advice is more than welcome.

Cheers,
Spencer R.

Could you expand on your use case a bit? What would the automation in DT do, exactly? Perhaps an example of the “set of search criteria or search parameters” you mention, and how those are derived from your data?

Here’s a script looking for websites related to the frontmost document:


property pMaxWords : 4

tell application id "com.devon-technologies.thinkpro2"
	try
		if not (exists content record) then error "Please select a document."
		
		set theRecord to content record
		set theWords to get concordance of record theRecord
		set theCount to (count of theWords)
		if theCount is greater than 0 then
			if theCount is greater than pMaxWords then set theWords to items 1 thru pMaxWords of theWords
			set {od, AppleScript's text item delimiters} to {AppleScript's text item delimiters, " "}
			set theQuery to theWords as string
			set AppleScript's text item delimiters to od
		else
			set theQuery to name of theRecord
		end if
		
		set theQuery to do JavaScript "encodeURIComponent('" & theQuery & "')" in think window 1
		set theurl to "http://www.google.com/search?as_q=" & theQuery & "&num=10&ie=UTF-8&start=0&filter=0"
		
		-- open tab for URL theurl
		
		tell application "DEVONagent"
			activate
			open URL theurl
		end tell
	on error error_message number error_number
		if the error_number is not -128 then display alert "DEVONthink Pro" message error_message as warning
	end try
end tell

Clearly I’m quite new to DevonThink, but I can try to refine my question.

Korm:
The principle I’d like to make use of is the “See Also & Classify” magic hat function. If DevonThink can associate articles within itself using whatever algorithms it does, is there a way to use a similar function between (or even just within) DevonAgent? Can the “Magic Hat” function be used in DA to pull articles from the web in the same way DevonThink pulls articles from its database?

For instance: If I select J.P. Gee’s article, “What Would a State of the Art Instructional Video Game Look Like?” and use the Magic Hat, my list shows Jonassen and Carr’s “Mindtools: Affording Multiple Knowledge Representations for Learning”. I don’t know how it does that, or if there are particular ways of modifying that function, but it seems a useful function for DevonAgent as well. Perhaps I am simply too inexperienced to know the alternative routes to my objective.

Edit I’ve realised that MH can be used in DA, but not with PDFs drawn from DT. Using cgrunenberg’s script for each article may be the way to go.

cgrunenberg :
Thank you for the script. I will now learn how to use them and see how it works for my purposes.