Jump to content
dvcrn

Alfred -> DEVONthink

Recommended Posts

Say there is a .doc file in DevonThink.

Alfred finds that file.

 

Now how can that file be revealed in DevonThing?

 

It seems that it is only possible to open the found file which opens Word?

 

 

Share this post


Link to post

Updated to 1.4.1 https://github.com/dvcrn/alfred-devonthink/releases/tag/v1.4.1

 

Uses score correctly now and the results are pretty good! Really liking this new search. 

I reduced the results per DB to 5 which seems a good sweetspot to not be too slow. If that's not enough you can change the value inside devonsearch.js

 

I tried to replicate what @sokolik_22 said but even for files that are not supported by DEVONthink, when I hit enter it just shows it in a DEVONthink window and doesn't open it in a different application. From there you can hit CMD-R and it will reveal the file inside DEVONthink

Share this post


Link to post

Updated to 1.4.1 but my search results still seem random. I type the exact full title of an item and it doesn't even show in the results. I think part of the issue is that, as far as I can tell, the results list is only based on the first search term. Adding a second word to the search doesn't update the search results.

Share this post


Link to post

@dvcrn After update, it works ok.

 

1. Search in Alfred: "ds <item>"

2. [Enter] on the found item in the Alfred list

–> The item opens in DevonThink

 

Remarks:

1. The search does not ignore diacritics. If there is "Ramón" in DevonThink, searching for "ds ramon" in Alfred does not reveal the "Ramón" DT item.

2. It searches also in Trash which I think is not handy.

 

Anyway, nice workflow!

 

Jiri

 

 

Share this post


Link to post
7 hours ago, gr37 said:

Updated to 1.4.1 but my search results still seem random. I type the exact full title of an item and it doesn't even show in the results. I think part of the issue is that, as far as I can tell, the results list is only based on the first search term. Adding a second word to the search doesn't update the search results.

 

Hrrm, can you tell me what it passes to the script? Open the workflow in alfred and hit the little bug icon on the top right. Then change "Interesting Information" to ""All Information" and execute the workflow while having that window open

Share this post


Link to post
Posted (edited)

@dvcrn @gr37 I experienced the same issue -- the search only uses the first word of the query and ignores any subsequent words. I think this is because multi-word queries are passed into devonsearch.js as multiple command line parameters, but devonsearch.js appears to only use the first one (line 38):

const query = argv[0];

I fixed the issue by changing the ds keyword script filter from "with input as argv" to "with input as query" and changing the bash command to this:

osascript ./devonsearch.js "{query}"

This ensures the full query is passed to devonsearch.js as a single command line parameter.

 

Nice workflow -- a very convenient way to interact with your content in DEVONthink. Thank you for sharing.

Edited by pwharrison

Share this post


Link to post
16 hours ago, pwharrison said:

@dvcrn @gr37 I experienced the same issue -- the search only uses the first word of the query and ignores any subsequent words. I think this is because multi-word queries are passed into devonsearch.js as multiple command line parameters, but devonsearch.js appears to only use the first one (line 38):


const query = argv[0];

I fixed the issue by changing the ds keyword script filter from "with input as argv" to "with input as query" and changing the bash command to this:


osascript ./devonsearch.js "{query}"

This ensures the full query is passed to devonsearch.js as a single command line parameter.

 

Nice workflow -- a very convenient way to interact with your content in DEVONthink. Thank you for sharing.

 

Thank you! I updated the workflow with this and released version 1.4.2. It should auto-update sometime 

Share this post


Link to post
Posted (edited)
17 hours ago, pwharrison said:

I fixed the issue by changing the ds keyword script filter from "with input as argv" to "with input as query" and changing the bash command to this:


osascript ./devonsearch.js "{query}"

This ensures the full query is passed to devonsearch.js as a single command line parameter.

 

The problem isn't $1 vs {query}, it's the lack of quotes (Alfred only ever passes a single argument to Script Filters. bash is splitting it into multiple arguments.)

 

$1 is preferred over {query}: Alfred doesn't need to re-write the script every time, and you don't have to worry about the escaping options (which are currently incorrect, btw: you also need to check Dollars).


So, the preferred way would be:

osascript ./devonsearch.js "$1"

 

Edited by deanishe

Share this post


Link to post
Posted (edited)

How do you import 1.4.2 into Alfred? Changing extension in the info does not work.
 

While waiting for a reply, a simple solution is to add a file filer workflow with search scope limited to "~/Library/Metadata/com.devon-technologies.think3"

Edited by slyfox

Share this post


Link to post

Stumbled across this workflow, and ... it's awesome !! Installed !!

 

Future feature request, if you're up for it: a way to enter multi-line note, or at least title and body lines, perhaps using some separator as a convention for this, or some other Alfred workaround ...

 

 

Share this post


Link to post
Posted (edited)

It does. Though, I think the workflow was updated recently? It's suddenly running quite slowly for me.

Edited by lutefish
wording

Share this post


Link to post

Most of the stuff works with DT3 but the search currently doesn't. The applescript needs updating to call the correct app and didn't get around to doing that yet. A hotfix is to just change the name inside the script to "DEVONthink 3" until DT3 is fully released

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...