Script for opening an indexed file or folder/group in DEVONthink from an external app (e.g., Finder, Alfred, HoudahSpot, etc.)?

@pete31 I can’t thank you enough!! It works!! This has been driving me crazy for so long. Thank you so much for all of your help!! You’re the best.

I made one very small change to your code so that the target file is selected in DEVONthink, and not its parent. So for others who are looking to mimic a “reveal” like action for files, especially when dealing with indexed files, the following works (i.e., substitute these lines with the ones you see in my previous post above):

				if theResults is not {} then
					repeat with theRecord in theResults
						set theResultsParent to (first parent of first item of theResults)
						set newWindow to open window for record incoming group
						set root of newWindow to root of (database of theResultsParent)
						set selection of newWindow to theResults as list
						activate
					end repeat
				else

I’ve also uploaded the full working version of the script here: Download. If you index files in Finder and want to quickly reveal them in DEVONthink, this script is great! And, if you’re an Alfred user, it’s very easy to just add the second half of the script to a workflow’s file action, making things even more convenient!

@pete31 I haven’t tried setting the bounds of the windows yet (in order to avoid the overlap issue). That’s a great idea for improving the script! I’ll tinker around with it a bit. To be honest, just opening the window is more than enough for me, however! You’re a lifesaver. I really appreciate your help with everything!