SearchEverything: Getting Opus to work with Everything

Glad you're finding ti useful as I do.
I looked into the problem and have a solution, however I haven't really tested it with all possible scenarios and for now it only works in normal (non-regex) mode so I'm flagging it as a beta.

Everything api (everything dll) expects a call with a single string.
For us to provide that string we take user input as arguments to SE.exe.
Up until now SE was only parsing the first argument in the command-line meaning
SE.exe search1 search2 would be seen as SE.exe "search1" skipping the second. Searches with spaces were supposed to be enclosed in "double quotes" as a single argument eg. "name doc|pdf" and the dopus button does that by default. This however breaks when we have a path in there like in your example. When you pass a quoted argument like a path with spaces its quotes are dropped after being consumed by the interpreter and that breaks the search again. So to not over-complicate things and force the escaping paths to the end user I decided to treat all arguments as parts of the same and any single argument which has spaces inside will be quoted.

Now we no longer use quotes for the whole thing:
old: "file:ext:doc|pdf C:\ dadada"
new: file:ext: doc|pdf "C:\Users\User with spaces\Documents with spaces" dadada
thus each space delimits its own argument and only arguments with spaces get quoted as to not break the search string.

Here's a link to an experimental version which handles it like that:

New button code (edit it to change to the actual path to your SE exe within the quotes):

<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" textcol="none">
	<label>Everything</label>
	<tip>Search with Everything (None = Dialog | Shift = Clipboard)</tip>
	<icon1>#filefind</icon1>
	<function type="normal">
		<instruction>@keydown:none</instruction>
		<instruction>Go NEWTAB </instruction>
		<instruction>@runmode:hide</instruction>
		<instruction>&quot;SearchEverythingCoreCLI.exe&quot; {dlgstring}</instruction>
		<instruction>@keydown:shift</instruction>
		<instruction>Go NEWTAB </instruction>
		<instruction>@runmode:hide</instruction>
		<instruction>&quot;SearchEverythingCoreCLI.exe&quot; {clip}</instruction>
	</function>
</button>
2 Likes