Devonthink extension - adding quotes around text for search

Is it possible to create an extension based on the current Devonthink extension so that the selected words have " " around them before being passed to Devonthink?

For example,

  1. I select the following words: PopClip appears when you select text with your mouse
  2. The extension adds double quote marks to the selected: “PopClip appears when you select text with your mouse”
  3. Then passes the words with the quotes for searching in Devonthink.

I have looked at the code for the extension but cannot work out how to do this.

Any help would be gratefully received.

1 Like

Hi @vw-popclip, welcome to the forum. I checked the code and I see that is a Service extension. Unfortunately, this means that there is no actual code in there to alter. It just calls DevonThink’s own service on the selected text.

What would be needed would be a way for an extension to insert code to transform the text (to add quotes) before calling the service. Now, this is certainly possible, but not with PopClip as it stands. I’ll note this down as an idea for improvement.

It might be possible to do it with a shell script, if there’s a way for shell scripts to call services. I’m not sure. Perhaps someone can say.

Nick,

Thank you very much for the detailed explanation.

Victor

1 Like