How to pass arguments to text editor in Search Result view?

I search all files in a folder for a keyword, and Directory Opus found some files.

Now I open the files and see where the keyword occurs.

I want my text editor automatically highlights the keyword that I typed in Directory Opus. I believe one way is to pass the keyword to text editor through command line arguments.

Is it possible for Directory Opus to do that?

Not currently, sorry. There isn't currently a way to access the search criteria and use it to pass arguments to other programs.

1 Like

Thanks for the timely reply. Can you add this feature? It greatly improves the search experience and helps beat Total Commander.

If the text editor you're using can do a find-in-files (i.e. for multiple files/folders) and has a command-line way to activate that, that might be a better way to do the same thing from Opus, and is something you could already set up now.

You could make a button in Opus which uses {dlgstring} to prompt you for the text to search for, which then runs the program and passes it the current directory and the entered text. (Or you could do more complex things with a script, even have a custom search UI that passes lots of parameters to the other program.)

On the other hand, sending the search criteria used in Opus to other programs would be difficult if you are using the Advanced search mode, as in the screenshot, since the filters could have any kind of data in them. (e.g. You could have a filter with multiple Contains fields; which one should be sent to the app?) Doing it for the Simple find mode might be possible, but if you aren't using that then it would not help you.

Oh, my tab so happened to remain on the Advanced tab. What I often do is the simple search. Passing the search keyword in simple search is good enough.

Your suggestion of using text editor to do find-in-finds is a valid workaround, considering so powerful Vim is :rofl:. However I prefer to do folder-oriented operations in file explorer and file-oriented operations in Vim.