DevonThink/Quicksilver integration

Hello

I guess this could as well be in the Scripting board…
Does anyone have any tips or finished scripts concerning integration of DevonThink into Quicksilver (quicksilver.blacktree.com/) ?

Things I’d love to do, sorted by priority, are:

1 - Add files I selected in Quicksilver easily to DevonThink. I already can add text snippets through the Services integration of Quicksilver but not files, as DevonThink does not have an Add file service.
2 - Search DevonThink articles from within QuickSilver and have the choice of opening them, grab their text content into QuickSilver, copy them to the clipboard or even paste them into the current textarea.

I think 1) at least might be doable from within AppleScript, and I thought I might ask here whether someone already has something finished, while 2) probably needs a Quicksilver plugin.

  1. should be definitely possible by using the “import” command

I’m a QS junkie as well. If anyone knows how to do #2 with QS, please point us to where we can get some info on getting this started. I would be happy to invest some time in it.

I would add that I, as well, would love to see the ability to search the current DevonThink database from within Quicksilver or (in my case) Launchbar. Both apps allow you to pass a string to an AppleScript, so it seems like this should be “easy” to someone who was familiar with AppleScript (which, sadly, is not me :frowning: Seems like something Chrisitan could bang out in 5 minutes (assuming he has 5 minutes :slight_smile:

Loving 1.1 BTW!

Nice to meet you, QS fans. This is already doable in QS.

1st pane: DT
2nd pane: Open File (not Open)
3rd pane: Finder Selection (or Current Selection)

Then, make a trigger and you are good to go. Select any file in Finder and hit the defined trigger. QS will import the files into the root level. (I’m using DT Personal.)

Aside from this topic, I sometimes wish that DT had search asap service. Lookup… service is nice but it waits for me to enter some search options.

Please have a look at this thread:
http://www.devon-technologies.com/phpBB2/viewtopic.php?t=2481

This is a little script for “Add file service”. It will handle single/multiple files from 1st pane of QS. The following code will link file(s) into DTP. If you want to import, see the comment in the code. It’s not heavily tested, but sort of works.

Paste the following code to Script Editor, and save it as ‘script’, not ‘application’ to ~/Library/Application Support/Quicksilver/Actions. Make sure Preferences/extras/Run tasks in background is set. You have to restart QS. I’m using QS b49 3763, DTP 1.1.

Bring up QS, or select files in Finder and press apple+esc, which is a default trigger for 'command window with selection. Then, pick the script name in the 2nd pane.


using terms from application "Quicksilver"
	on open theFiles
		try
			tell application "DEVONthink Pro"
				repeat with aFile in theFiles
					set theFile to POSIX path of aFile
					--replace indicate with import, if you want to import.
					indicate theFile
				end repeat
			end tell
		on error error_message number error_number
			if the error_number is not -128 then
				try
					display alert "DEVONthink Pro" message error_message as warning
				on error number error_number
					if error_number is -1708 then display dialog error_message buttons {"OK"} default button 1
				end try
			end if
		end try
	end open
end using terms from