Jump to content

DEVONthink Document Search [updated to version 1.3]


Recommended Posts

Posted (edited)

DEVONthink Document Search

 

This workflow helps you to find your DEVONthink documents from within Alfred. It supports DEVONthink Personal as well as DEVONthink Pro (with multiple databases).

 

Installation

 

Download from GitHub and import into Alfred 2.

 

Usage

 

Keywords

  • Search in all databases
devon [your search string]

devon.png

 

  • Search in specific database
devondb [your search string]

devondb1.png

devondb2.png

 

 

 

  • Refresh DEVONthink datanase list

    The association between database names and uuids can only be obtained via AppleScript. This is done automatically if you run the "devondb" command for the first time. The information is then cached for better performance. If you add a new DEVONthink database later on, you'll have to run the "devondb!" command to refresh the database list.
devondb!

devondb!.png

Edited by _mk_
Posted

This is awesome _mk_. 

 

Thank you so much!

 

I was hoping you could make a tweak or two if possible?

 

I have a database that has all my email in it. (about 14,000 emails.) When I want to find anything other than an email I am flooded with emails because there are so many. Is it possible to either specify a database to search in or add some syntax to potentially include operators like "-", perhaps quotes for phrases, or a wildcard like "*"?  If *any* (I don't need all, I just need a way to filter things a bit) of the following search strings were possible it would be heaven:

  1. devon strategy*.pages
  2. devon "strategy document"
  3. devon <databasename> strategy
  4. devon strategy -mailto:

Are any of these possible? Any single one would make it perfect. Unfortunately, due to the overwhelming amount of content I have in my databases, there's just too much to be able to use a simple keyword search and get relevant results.

 

If it's not possible or if it's a huge pain in the arse, no problem, I just thought it was worth asking.

 

Thanks!

Posted

This is awesome _mk_. 

 

Thank you so much!

 

I was hoping you could make a tweak or two if possible?

 

I have a database that has all my email in it. (about 14,000 emails.) When I want to find anything other than an email I am flooded with emails because there are so many. Is it possible to either specify a database to search in or add some syntax to potentially include operators like "-", perhaps quotes for phrases, or a wildcard like "*"?  If *any* (I don't need all, I just need a way to filter things a bit) of the following search strings were possible it would be heaven:

  1. devon strategy*.pages
  2. devon "strategy document"
  3. devon <databasename> strategy
  4. devon strategy -mailto:

Are any of these possible? Any single one would make it perfect. Unfortunately, due to the overwhelming amount of content I have in my databases, there's just too much to be able to use a simple keyword search and get relevant results.

 

If it's not possible or if it's a huge pain in the arse, no problem, I just thought it was worth asking.

 

Thanks!

 

A database switch is already on my todo list. I'll have a look at the rest.

Posted

Hi Marko,

 

I’ve sent the following email off to Eric, President of DEVONtechnologies the following email in which I recommend this workflow as another integrating tool to be used with DEVONthink. I feel this is a very useful piece of integration that works with structure of DEVONthink extremely well. I do mention your Omni workflow and although its impressive in terms of the work you’ve put into it, I have certain way of working with Omni that the workflow, though it could be useful at times, I don’t see nearly as useful as the DEVONthink workflow. I hope that’s alright with you. I haven’t had enough time to play with your Omni workflow though but as you’ll see in my email, Omnifocus is of a different nature than DEVONthink. You’re workflow fits into the DEVONthink architecture beautifully. 

 

I also beta test for Omni and am working with OmniFocus 2. I dialogue directly with the product manager there and Ken Case occassionally who is the president and I might mention the workflow but at this point in time we’re so busy with the beta of OmniFocus v2 its a bit difficult for me to wrap my mind around it. I will play with it a bit. I can say from the little I’ve used it, it works fine with OmniFocus v2 but that’s because the data structures are the same between OmniFocus 1 and 2. 

 

So this is great about the DEVONthink workflow. I’ll let you know what Eric’s response is. Since he lives in Stuttgard I don’t expect to here from him till about 4 am my time :).

 

Kerry

 

----

 

 

Eric,

 
The following is a link from Marko’s post on the Alfred forums to download a workflow that allows you from Alfred (so anywhere you happen to be) to search your DEVONthink databases for info and then once you find what your looking for in Alfred you just choose enter or it assigns hot keys in the list to open the item directly and it opens your DEVONthink note. Its actually very nifty and handy.
 
So as an example I’ve assigned opt-spacebar to open the Alfred window or we can think of as a command line:
 
>>>>>Marko this is a picture of the Alfred interface with what I’m searching for<<<<<<
 
In Alfred I type for this particular workflow >devon what I’m looking for”<. So I wanted to see if i had stored in DEVONthink my Chronosync serial # and I typed >devon econ serial< and Alfred returned 5 hits of DEVONthink records only and of the 5 hits one was my serial #. Its actually very handy as a DEVONthink user. 
 
I feel this is yet another form of DEVONthink integration that we should let users know is available to them. You’d want though to include this workflow probably on the DEVONthink site although to use it you have to have the Alfred 2 PowerPack so there’d be no reason not to just go and grab from the Alfred 2 shared workflow forums. 
 
Here there are a number of workflows people have started to develop for Alfred 2. Marko has actually developed one for Omni that I haven’t had much time to play with but I think it might be handy too. However, with Omni, since I’m doing so much in it I tend to use the quick capture to inbox dialogue wherever I am constantly. Further, I like to sit in Omni and kind of review things and tick off what’s done, what needs to be done etc. So its different than DEVONthink in that I don’t need to sit in DEVONthink. I think the DEVONthink workflow is much more beneficial but that’s my view.
 
Here it is:
 
Download from GitHub and import into Alfred 2.
 
Kerry
Posted

Thanks Marko!

 

I do love the awesome power of DEVONthink but with the ease of Alfred it adds a whole new level of speed that can, depending on circumstances, be a bit annoying. (Obviously my giant databases do not help the situation.)

 

Kerry,

 

Great to see that DEVONthink looks and listens.  I do quite a bit of 'listening' in my profession and anytime I see a brand with a digital product being proactive and actually paying attention to the marketplace and, in fact, digital as a whole, it instantly gives me a very positive impression of the brand.

 

Bear in mind, I don't mean just having Twitter, but I mean actually seeking out comments, opportunities and an audience.  It's great to see DEVONtech is on that list. I've always had a positive opinion and would highly recommend your products, but maybe just because of my impression, now I'm even more happy to have DEVONthink on my list of 'most important' apps.

 

Kudos folks.

 

Thanks again.

Posted

Hi

I'm having a problem with this workflow. When I type 'devon ' it shows the workflow correctly but when I start to type the search query, 'h' for example, it changes to a Google search for 'devon h'. Any idea why?

Posted

@kelpie:  You may try this-- Start up the Devonthink application.  After a few minutes, quit the application.  (this will populate the metadata folder located at ' Library > Cache > Metadata' with Devonthink's data).   Then try your search again in Alfred.   I notice I have to do this after using a cleaning program like Onyx or similar.

Posted

@kelpie:  You may try this-- Start up the Devonthink application.  After a few minutes, quit the application.  (this will populate the metadata folder located at ' Library > Cache > Metadata' with Devonthink's data).   Then try your search again in Alfred.   I notice I have to do this after using a cleaning program like Onyx or similar.

Thank you, that indeed solved the problem. I must make sure I don't clean that out in future.

 

@kerrydawson for info it is DEVONthink Pro Office

 

Cheers

Posted

Thank you, that indeed solved the problem. I must make sure I don't clean that out in future.

 

@kerrydawson for info it is DEVONthink Pro Office

 

Cheers

Yeah that's one I use and I don't have any problem. Its interesting, I noticed when I'd run Onyx (I don't anymore) that I'd have that problem but not with this but with some other applications and I'd have to kind of do a similar thing and it would work again. 

 

I'm not really running any of these kind of programs. What I do run which just runs in background is CheckMate from Micromat and all it does is just check the system on a regular basis for problems such volume structures failure. If it reports a problem then I'll run a tool but I'm tending to run less aggressive stuff like Apple's own disk utilities and then all is fine and CheckMate just goes of and does it thing. I never really even think about it till I notice its icon blinking in red so then I'l see whats up and take the corrective action. 

 

You might want to take a look at this as it saves you from having to do anything till a problem turns up. I got a little tired of these more aggressive utilities doing exactly what @drking pointed out. Works well.

  • 2 weeks later...
Posted

Version 1.1

 

The workflow was updated to version 1.1 and add's the possibility to only search in a specific DEVONthink database if multiple are available.

 

The association between database names and uuids can only be obtained via AppleScript. This is done automatically if you run the "devondb" command for the first time. The information is then cached for better performance. If you add a new DEVONthink database later on, you'll have to run the "devondb!" command to refresh the database list.

 

See the first post for more details.

Posted

I installed version 1.1, but it says I have no databases! I have DevonPro 2.5.2.

 

Have you tried the devondb! keyword to update the database list?

 

If that's not working, could you run the setup script from inside the workflow directory and send me the output.

Posted

Hi _mk_,

I'm still happily using the original version. I really only have two DB's at this time that I actively use and a couple more and growing that become archival DBs. I prefer searching across DBs rather than specifically in them. I'm assuming doing your upgrade wouldn't change the way I do things as I'm happy now with the output. Often I'll get to the file I'm looking for and using Alfred's shift key to look inside I'll have found what I want. So if I upgrade, everything will remain the same? :)

Sometimes, I do have to go to DEVONthink itself and use its advanced search functionality and AI technology but I don't unless I need to. Oddly enough, I agreed to do an interview for a podcast on DEVONthink and I thought it was going to have a certain focus but the interviewer wants to do that but with attention to DEVONthink's AI technology LOL! I better do a few practice runs to make sure I haven't gotten to reliant on my butler. I don't think it'll sound too good if I'm asked a question in this area and then I call out Alfred oh Alfred ..... and I get back could you please elaborate and I go Alfred where are you ..... ALFRED!!!!!!!!!!!!

Posted

Have you tried the devondb! keyword to update the database list?

 

If that's not working, could you run the setup script from inside the workflow directory and send me the output.

 

Yes, I ran devondb! and it said there were no databases. The setup routine shows this:

 

 

A61B0FBE-8A38-4D90-9AB1-E3CCFC6D7F1C|Church
F994146D-D359-4DAB-9928-9BF76E5D88D6|Missions
BC3C4911-4363-43B8-9090-D35B85C27458|Personal
291253F3-E462-4BC5-8FFE-AF7B9BF1D769|Sermons
EF88DBA1-06E9-4D5A-8005-8FDA378A4C07|Inbox

 

Does that help?

Posted

Yes, I ran devondb! and it said there were no databases. The setup routine shows this:

 

 

A61B0FBE-8A38-4D90-9AB1-E3CCFC6D7F1C|Church
F994146D-D359-4DAB-9928-9BF76E5D88D6|Missions
BC3C4911-4363-43B8-9090-D35B85C27458|Personal
291253F3-E462-4BC5-8FFE-AF7B9BF1D769|Sermons
EF88DBA1-06E9-4D5A-8005-8FDA378A4C07|Inbox

 

Does that help?

 

Hmm ... so the setup script finds your databases. Could you please check if there is a file called databases in

~/Library/Application Support/Alfred 2/Workflow Data/com.markokaestner.devonthinksearch

What does the devon.log inside the workflow directory say?

Posted

I just downloaded the new version and it works the way I want.

 

Actually in my testing I imported a number of fresh emails into DEVONthink and typed in a keyword I knew would be there and the fresh files turned up yet 5 of them had the same title as they are just different to/from emails. Pressing the shift key I wasn't able to look in these files. I did actually have to jump to DEVONthink and use the AI search engine to find these files and see what specifically was in each one to find the critical one I wanted.

 

There's definitely a keen balance that has to be struck between what Alfred can do and where you need the horsepower of DEVONthink to step in. This was actually a good exercise for me to. Kind of fortuitous.

Posted

Hmm ... so the setup script finds your databases. Could you please check if there is a file called databases in

~/Library/Application Support/Alfred 2/Workflow Data/com.markokaestner.devonthinksearch

What does the devon.log inside the workflow directory say?

 

I'm having the same trouble; devondb! returns 0 databases, but setup shows the expected output. My log reports that the databases file doesn't exist, which is indeed true; the folder isn't even in "Workflow Data."

./search: line 9: /Users/danielsh/Library/Application Support/Alfred 2/Workflow Data/com.markokaestner.devonthinksearch/databases: No such file or directory
./search: line 12: /Users/danielsh/Library/Application Support/Alfred 2/Workflow Data/com.markokaestner.devonthinksearch/databases: No such file or directory
<?xml version='1.0'?><items>
<item uid='13686176981' arg='all' valid='yes' autocomplete=''><title>All databases</title><subtitle></subtitle><icon>icon.png</icon></item> </items>

user.workflow.29738129-4604-40FB-90DF-595F0EE93F50 danielsh$ ./setup
C87C2F4E-376D-4834-87E1-B357835D91E4|Academy
8CE9316C-21C0-43FD-9DDC-7ECA91E8EA23|Inbox
Posted (edited)

 

I'm having the same trouble; devondb! returns 0 databases, but setup shows the expected output. My log reports that the databases file doesn't exist, which is indeed true; the folder isn't even in "Workflow Data."

./search: line 9: /Users/danielsh/Library/Application Support/Alfred 2/Workflow Data/com.markokaestner.devonthinksearch/databases: No such file or directory
./search: line 12: /Users/danielsh/Library/Application Support/Alfred 2/Workflow Data/com.markokaestner.devonthinksearch/databases: No such file or directory
<?xml version='1.0'?><items>
<item uid='13686176981' arg='all' valid='yes' autocomplete=''><title>All databases</title><subtitle></subtitle><icon>icon.png</icon></item> </items>

user.workflow.29738129-4604-40FB-90DF-595F0EE93F50 danielsh$ ./setup
C87C2F4E-376D-4834-87E1-B357835D91E4|Academy
8CE9316C-21C0-43FD-9DDC-7ECA91E8EA23|Inbox

 

Ahh ... my fault. The com.markokaestner.devonthinksearch folder is missing on your machines but will not be created. So the database list cannot be stored. Seems that I'll have to create a new release when I am home this evening. Sorry for the inconvenience.

 

In the meantime you could create the folder manually to get the workflow up and running:

mkdir -p "~/Library/Application Support/Alfred 2/Workflow Data/com.markokaestner.devonthinksearch"
Edited by _mk_
Posted

Hmm ... so the setup script finds your databases. Could you please check if there is a file called databases in

~/Library/Application Support/Alfred 2/Workflow Data/com.markokaestner.devonthinksearch

What does the devon.log inside the workflow directory say?

 

 

Nope, that directory does not exit. I deleted the workflow and re-installed, but it is still not creating a directory by that name. I am using the latest Alfred also (2.0.3 (187)). Not sure what the problem is. Many of the other workflows have their directory okay. I created the directory and now the workflow works okay. Therefore, there is code missing to make that directory, or Alfred goofed!

 

Thanks for the help. I am really liking that workflow now!

Posted

Nope, that directory does not exit. I deleted the workflow and re-installed, but it is still not creating a directory by that name. I am using the latest Alfred also (2.0.3 (187)). Not sure what the problem is. Many of the other workflows have their directory okay. I created the directory and now the workflow works okay. Therefore, there is code missing to make that directory, or Alfred goofed!

 

Thanks for the help. I am really liking that workflow now!

 

It's not Alfred's fault but mine. I just forgot to add the code to create the folder.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...