Jump to content
Mpco

DEVONthink Pro Search

Recommended Posts

e2e02d7902639b523e513fac4898b609.png.173c0a5c14035d934b1d6cc9796469a1.png

 

Usage

  • Type dnt + keywords to search in all opened databases.
  • Type dnd to choose which datebase to search
    • Press Enter, then type in keywords to search in the chosen database.
    • Press ⌘Command + Enter to list all tags in the database, then choose a tag and press Enter to list all documents which have the tag.
  • Type dnm + tag1, tag2, ... to list all documents which have these tags in all database. Tags inputed must be exact. For example, Tag aBcD can't be inputed as aBc or abcd

After documents were listed,

  • Press Enter to open the selected result with DEVONthink.
  • Press ⌘Command + Enter to open with external editor.
  • Press ⌥Option + Enter to reveal result in DEVONthink.

 

You can download it from Github

Edited by QqzgpCAo
add screenshot

Share this post


Link to post

Many thanks for sharing.  I'm having an issue where the general dnt search (of DT Pro) isn't responding or returning any results, whereas a dnd search of a particular database works fine.

Share this post


Link to post

It freezes - dnt logs this:

Starting debug for 'DEVONthink Pro Search'

 

[2018-12-04 09:12:50][input.scriptfilter] Queuing argument 's'

[2018-12-04 09:12:50][input.scriptfilter] Queuing argument 'so'

[2018-12-04 09:12:50][input.scriptfilter] Queuing argument 'sot'

[2018-12-04 09:12:50][input.scriptfilter] Queuing argument 'soth'

[2018-12-04 09:12:50][input.scriptfilter] Queuing argument 'sothe'

[2018-12-04 09:12:50][input.scriptfilter] Queuing argument 'sotheo'

[2018-12-04 09:12:51][input.scriptfilter] Queuing argument 'sothe'

[2018-12-04 09:12:51][input.scriptfilter] Queuing argument 'sothew'

[2018-12-04 09:12:51][input.scriptfilter] Queuing argument 'sothewo'

[2018-12-04 09:12:51][input.scriptfilter] Queuing argument 'sothewor'

[2018-12-04 09:12:51][input.scriptfilter] Queuing argument 'sothewort'

[2018-12-04 09:12:52][input.scriptfilter] Queuing argument 'sotheworth'

 

I have some large databases (>3 gigs) containing indexed folders themselves pointing to gigabytes of files, and I think that's where the script is failing, as a dnd search of that particular database also times out.

Share this post


Link to post
On 12/5/2018 at 1:16 AM, lutefish said:

It freezes - dnt logs this:

Starting debug for 'DEVONthink Pro Search'

 

[2018-12-04 09:12:50][input.scriptfilter] Queuing argument 's'

[2018-12-04 09:12:50][input.scriptfilter] Queuing argument 'so'

[2018-12-04 09:12:50][input.scriptfilter] Queuing argument 'sot'

[2018-12-04 09:12:50][input.scriptfilter] Queuing argument 'soth'

[2018-12-04 09:12:50][input.scriptfilter] Queuing argument 'sothe'

[2018-12-04 09:12:50][input.scriptfilter] Queuing argument 'sotheo'

[2018-12-04 09:12:51][input.scriptfilter] Queuing argument 'sothe'

[2018-12-04 09:12:51][input.scriptfilter] Queuing argument 'sothew'

[2018-12-04 09:12:51][input.scriptfilter] Queuing argument 'sothewo'

[2018-12-04 09:12:51][input.scriptfilter] Queuing argument 'sothewor'

[2018-12-04 09:12:51][input.scriptfilter] Queuing argument 'sothewort'

[2018-12-04 09:12:52][input.scriptfilter] Queuing argument 'sotheworth'

 

I have some large databases (>3 gigs) containing indexed folders themselves pointing to gigabytes of files, and I think that's where the script is failing, as a dnd search of that particular database also times out.

 

Sorry, I don't have the large databases and can't test. But I attach a script file to search in all opened devonthink databases which is the core of dnt. You can download it, uncompress,  open, and then press ⌘Cmd-R to run. You can also change the search keyword theKeywords in second line of the script and test how long the searching in large databases.  Then paste the result here.

 

Download: https://github.com/mpco/AlfredWorkflow-DEVONthink-Search/files/2651576/coreSearchScript.zip

Share this post


Link to post

Mpco - many thanks. When I run the script you posted directly, it works fine, and takes only a few seconds for results to appear in the Script Editor window. But, running dnt directly still just fails silently with a time-out. Running dnd and choosing a database and searching works fine. Is it connected somehow to dnt coming after dnd, rather than being a toplevel option somehow?

Share this post


Link to post
16 hours ago, lutefish said:

Mpco - many thanks. When I run the script you posted directly, it works fine, and takes only a few seconds for results to appear in the Script Editor window. But, running dnt directly still just fails silently with a time-out. Running dnd and choosing a database and searching works fine. Is it connected somehow to dnt coming after dnd, rather than being a toplevel option somehow?

 

Hi, download this version https://github.com/mpco/AlfredWorkflow-DEVONthink-Search/files/2657674/DEVONthink.Pro.Search.zip and test dnt.

I changed some configs in it.

Share this post


Link to post

Mpco - I just downloaded the most recent release - thanks so much for keeping this up to date. I started seeing very slow searches in DT3b3 and still in DT3b4. It's not timing out. I tried running the script with logging enabled, and there's fully 7 or so seconds between when I enter text and results are returned: 

[11:23:10.768] Logging Started...

[11:23:17.517] DEVONthink Search[Script Filter] Queuing argument 'c'

[11:23:18.774] DEVONthink Search[Script Filter] Queuing argument 'chancery'

[11:23:24.083] DEVONthink Search[Script Filter] Script with argv 'chancery' finished

 

Thanks for a brilliant workflow - just wanted to draw your attention to the issue.

Share this post


Link to post
1 hour ago, lutefish said:

Thanks for a brilliant workflow - just wanted to draw your attention to the issue.

 

There's really not much that can be done to actually improve the speed of the search: calling applications via AppleScript is fundamentally slow.

 

However, you might be able to get faster results by changing the Script Filter to only search once. Open the Script Filter, click the Run Behaviour button and change the Queue Delay settings. For slow-ish searches, I find that setting Queue Delay to "Automatic delay after last character typed" provides the best results.

 

Share this post


Link to post

Many thanks for the suggestion. That option was already set, and changing Run Behaviour to various settings didn't change things. But, again, thanks - it was worth a try.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...