SearchEverything: Getting Opus to work with Everything

@eugenesv I'm afraid jscript and vbscript don't facilitate calling conventions in dll functions by themselves. Afaik dopus can use python and perl scripts if the interpreters are installed but I haven't delved into that field. The way I see it without those is perhaps calling an external program/script to generate the info you need by saving it to a temp json file for example and when the external one completes you consume the output in your dopus script. I've used this approach to add a column with custom generated data when making Column based on Descript.ion-style file parsing. Still it's not that convenient so someone else might provide a better solution.

Oh, that's very unfortunate :frowning:
By the way, maybe it's an identical question, but is there a way to maybe build your project as a dll, but not the one requiring this ctypes.WinDLL calls (these would be handled "inside" the dll), but exposing something more jscript/vbscript friendly? I've encountered mentions of ActiveXObject/CreateObject/GetObject commands, are they relevant to this task?

Will check the forum re. Python (I do have it installed), though I vaguely remember reading a post that it's not supported and there were no plans to add support.

Re. the helper file, the whole idea of this column was to avoid doing any extra disk I/O and read from that instant magical :mage: in-memory DB that is Everything.
It might be simple to just run the CLI interface es.exe on a ^full-path$ regex (to guarantee getting only a single item in the output) to get a Size - name string and parse it to get rid of the name, but then it also seems not quite right to launch a console command for every file, will have to see the performance with a packed folder...

Now that you mention it, registering a dll as an ActiveXobject would indeed work. I'll need some time to look into and implement that.

1 Like

Nice! Meanwhile, I've got a simple button with the stock Python 3.8+pywin32 script working (after a short registry hack to add Python to the list of DO scripting languages) :wink: (all from this old thread)
Will try to see if anything more complex is possible...

1 Like

@apocalypse Thanks for writing this great app. I've been using it lately and it works well, but I've encountered a particular issue when including Everything's modifiers and functions in the search string.

When searching in Everything, I often include modifiers/functions in my search string, something like file: ext:pdf;doc "C:\My Documents" StringToSearch. From my initial tests, it seems that when I pass a string like this to SearchEverythingCoreCLI.exe, it sometimes doesn't parse the quotes properly and the search either fails or returns incorrect results. I also notice that it doesn't accept any macros (filters in Everything) like doc: or pic: or <doc:|pic:> to narrow the search to particular file types.

Just to experiment, I tried doubling the quotation marks but that didn't work. What did seem to work sometimes was escaping the quotation characters with a backslash, but in some instances, that also didn't work.

I've looked through the source code for your app and can't find any particular reason why certain strings containing special characters aren't parsed properly. I'm not sure if the issue is with SearchEverythingCoreCLI.exe and the way it's handling strings, or if the problem is a result of how Everything accepts the string from SearchEverythingCoreCLI.exe, or if it's the way DOpusrt.exe is accepting the string.

I'm hoping you can clarify how exactly the search string is being passed to Everything (and then to DOpusrt.exe) and if there are any special characters I need to escape (and how).

Cheers

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

Many thanks for the clear explanation and the new update for SE.exe! I'm going to test it out in various scenarios and let you know how it goes.

Cheers

I've been testing various search strings with the new beta, and I can confirm that the following works:

files: ext:pdf;doc "C:\My Documents" StringToSearch

What doesn't seem to work is combining multiple paths with Everything's grouping syntax (i.e. "<>"), as well as single folder searches with wildcards. Below I've listed some search strings which failed using the new beta:

Multiple full paths in a group:
files: ext:pdf;doc "<C:\My Documents|C:\Another folder with spaces>" StringToSearch

Single folder name with wildcards:
files: ext:pdf;doc "<\Documents !*\Documents*\*\*>" StringToSearch

For some reason, doubling up the quotes in the previous command does work, like: files: ext:pdf;doc ""<\Downloads !*\Downloads*\*\*>"" StringToSearch
Note: Doubling up the quotes on all the other examples I've listed does not work.

Using any macro filter (like "doc:") fails:
files: doc: "C:\My Documents" StringToSearch

Replacing the macro with the extension filter as in my first example does work though, e.g. files: ext:pdf;doc "C:\My Documents" StringToSearch

I read in the Everything Search documentation that the command line interface (es.exe) doesn't support macros, so perhaps the DLLs also don't support macro filters.


I wonder if it'll be possible to make some adjustments to SearchEverythingCoreCLI.exe to allow the above searches to work.

I'll look into the < > problem.
Everything API doesn't seem to expand macro filters when they come from the DLL wrapper or the CLI - the only way I see them working is by manually handling and expanding them in SE and feeding them as extensions to everything.

Thanks for taking the time to look into it - really appreciated! If I can be of any help beta testing or anything, just let me know.

Hi thank you for this nice plug in. I am struggling to use search syntax though, how do i search for file type with a key word? e.g. in everything i can search for cat pics (JPG,PNG etc) with the following; "pic: cat". This same syntax does not produce any results in the OPUS plugin. any help appreciated. Thanks

@Maciej1
It's a limitation of everything's search api. Only the everything interface itself can expand keywords like that. I've thought about implementing the conversion in SE but I can't make any promises as to when it will happen.
For the time being you can use
cat .jpg|.jpeg|.png|.gif|.bmp|.psd
to get the same result.

You could save that as in image search button in dopus as not to type the extensions every time.

<?xml version="1.0"?>
<button display="both" label_pos="right">
	<label>Search Images (Dialog)</label>
	<tip>Search Everything for Images</tip>
	<icon1>#default:find</icon1>
	<function type="normal">
		<instruction>Go NEWTAB </instruction>
		<instruction>@runmode:hide</instruction>
		<instruction>&quot;Path\To\SearchEverythingCoreCLI.exe&quot; &quot;{dlgstring} .jpg|.png|.gif&quot;</instruction>
	</function>
</button>

Thank you very much for your reply and clarification. Cheers for all you work with this

1 Like

Many thanks for the integration between these two great programs!

1.) Quick Search Field. I was wondering if I could put a "quick search field" (similar to the one built into DOpus) on the toolbar rather than clicking a button which opens a dialog box.

2.) Display in new tab. Second question, can I get the file collection of search results to open in a new tab rather than current tab?

this is splendid.
new to opus but not everything (took me quite some time to work out how to add the script to a new button!)
the two combined are a delight.
thanks @apocalypse for all your hard work.

1 Like

Using simply by adding path command in everything search as global key fits my need. The as fpllows

cd "D:\Program Software\Everything"
@async:"D:\Program Software\Everything\Everything.exe" -p  {sourcepath|noterm}

If you want more command words the below as follows

Everything.exe [filename] [-options]

filename	Open the specified file list.

-?	Show this help.
-admin	Run "Everything" as Administrator.
-admin-server-share-links	Use \\Server\C$ links for ETP connections.
-app-data	Store data in application data.
-bookmark <name>	Open a bookmark.
-case	Enable case matching.
-choose-language	Show the language selection page.
-choose-volumes	Do not automatically index volumes.
-close	Close the current search window.
-config <filename>	The filename of the ini file.
-connect <user:pass@host:port>	Connect to an ETP server.
-console	Show the debugging console.
-copyto <filename1> <...>	Show the multi-file renamer with the specified filenames.
-create-file-list <filename> <path>	Create a file list of a path.
-create-file-list-exclude-files <list>	exclude the semicolon delimited wildcard filter for files.
-create-file-list-exclude-folders <list>	exclude the semicolon delimited wildcard filter for folders.
-create-file-list-include-only-files <list>	include only the semicolon delimited wildcard filter for files.
-create-usn-journal <volume> <max-size-bytes> <allocation-delta-bytes>
-db <filename>	The filename of the database.
-debug	Show the debugging console.
-debug-log	Log debugging information to disk
-delete-usn-journal <volume>	Delete a USN Journal.
-details	Show results in detail view.
-diacritics	Enable diacritics matching.
-disable-run-as-admin	Disable run as administrator.
-disable-update-notification	Disable update notification on startup.
-drive-links	Use C: links for ETP connections.
-edit <filename>	Open a file list with the file list editor.
-enable-run-as-admin	Enable run as administrator.
-enable-update-notification	Enable update notification on startup.
-exit	Exit "Everything".
-first-instance	Only run if this is the first instance of "Everything".
-filelist <filename>	Open a file list.
-filename <filename>	Search for a file or folder by filename.
-filter <name>	Select a search filter.
-focus-bottom-result	Focus the bottom result.
-focus-last-run-result	Focus the last run result.
-focus-most-run-result	Focus the most run result.
-focus-results	Focus the result list.
-focus-top-result	Focus the top result.
-ftp-links	Use ftp://host/C: links for ETP connections.
-fullscreen	Show the search window fullscreen.
-h	Show this help.
-help	Show this help.
-home	Open the home search.
-install <location>	Install "Everything" to a new location.
-install-client-service	Install the "Everything" client as a service.
-install-config <filename>	Install the specified ini file.
-install-desktop-shortcut	Install desktop shortcut.
-install-efu-association	Install EFU file association.
-install-folder-context-menu	Install folder context menus.
-install-quick-launch-shortcut	Install Quick Launch shortcut.
-install-run-on-system-startup	Install "Everything" from the system startup.
-install-service	Install and start the "Everything" service.
-install-service-pipe-name <name>	Use the specified name for the "Everything" service pipe name.
-install-service-security-descriptor	Specify the pipe security descriptor.
-install-start-menu-shortcuts	Install "Everything" shortcuts from the Start menu.
-install-url-protocol	Install URL Protocol.
-instance <name>	The name of the "Everything" instance.
-l	Load the local database.
-language <langID>	Set the language to the specified language ID.
-load-delay <milliseconds>	The delay in milliseconds before loading the database.
-local	Load the local database.
-matchpath	Enable full path matching.
-maximized	Maximize the search window.
-minimized	Minimize the search window.
-moveto <filename1> <...>	Show the multi-file renamer with the specified filenames.
-name-part <filename>	Search for the name part of a filename.
-newwindow	Create a new search window.
-noapp-data	Store data in executable location.
-nocase	Disable case matching.
-nodb	Do not save to or load from the "Everything" database file.
-nodiacritics	Disable diacritics matching.
-nofullscreen	Show the search window in a window.
-nomatchpath	Disable full path matching.
-nomaximized	Unmaximize the search window.
-nominimized	Unminimize the search window.
-nonewwindow	Show an existing search window.
-noontop	Disable always ontop.
-noregex	Disable Regex.
-noverbose	Display only basic debug messages.
-nowholeword	Disable match whole word.
-noww	Disable match whole word.
-ontop	Enable always ontop.
-p <path>	Search for a path.
-parent <path>	Search for files and folders in the specified folder.
-parentpath <path>	Search for the parent of a path.
-path <path>	Search for a path.
-quit	Exit "Everything".
-read-only	Loads the database in read-only mode.
-regex	Enable Regex.
-reindex	Force database rebuild.
-rename <filename1> <...>	Show the multi-file renamer with the specified filenames.
-s <text>	Set the search.
-search <text>	Set the search.
-search-file-list <filename>	Search the specified text file for a list of file names.
-select <filename>	Focus and select the specified result.
-server-share-links	Use \\Server\C: links for ETP connections.
-service-pipe-name <name>	connect to the service pipe with the specified name.
-sort <name>	Set the sort to the specified name.
-sort-ascending	Sort ascending.
-sort-descending	Sort descending.
-start-client-service	Start the "Everything" client service.
-start-service	Start the "Everything" service.
-startup	Run "Everything" in the background.
-stop-client-service	Stop the "Everything" client service.
-stop-service	Stop the "Everything" service.
-svc	Run "Everything" as a service.
-svc-pipe-name <name>	Host the pipe server with the specified name.
-svc-security-descriptor <sd>	Host the pipe server with the security descriptor.
-thumbnail-size <size>	Specify the size of thumbnails in pixels.
-thumbnails	Show results in thumbnail view.
-toggle-window	Hides the current foreground search window or shows the search window.
-uninstall [path]	Uninstall "Everything" from the specified path.
-uninstall-client-service	Uninstall the "Everything" client service.
-uninstall-desktop-shortcut	Uninstall desktop shortcut.
-uninstall-efu-association	Uninstall EFU file association.
-uninstall-folder-context-menu	Uninstall folder context menus.
-uninstall-quick-launch-shortcut	Uninstall Quick Launch shortcut.
-uninstall-run-on-system-startup	Remove "Everything" from the system startup.
-uninstall-service	Uninstall the "Everything" service.
-uninstall-start-menu-shortcuts	Uninstall "Everything" shortcuts from the Start menu.
-uninstall-url-protocol	Uninstall URL Protocol.
-uninstall-user	Uninstall user files.
-update	Save the database to disk.
-url <[es:]search>	Set the search from an ES: URL.
-verbose	Display all debug messages.
-wholeword	Enable match whole word.
-ww	Enable match whole word.

one of my collegue used this to search

cd "D:\Program Software\Everything"
@async:"D:\Program Software\Everything\Everything.exe" -p  {sourcepath|noterm} -s  {dlgstring} 

I hope this helps.

Yes, choose customize and edit for the button and add "GO NEWTAB" in a new line below the everything path.

@keydown:none
"C:\Program Files\Everything\SearchEverythingCoreCLI.exe" "{dlgstring}"
GO NEWTAB

EDIT: Perhaps it is better to put the "GO NEWTAB" above the path. Seems to cause empty search results sometimes otherwise. ?!

I have a very strange behavior for the clipboard text search. If the search result is empty the program which had the focus before using Opus gets again the focus.
How can this happen?

Example: I'm using the webbrowser. Then I switch to Opus and right click on the button. The webbrowser has again the focus.

And after standby or longer idle time the first left mouse button search is empy. Second search gives results...
But everything itself shows always item.
Strange. Perhaps an issue du to the "go newtab" as last line? Tried now the version 2.0 and when I move the "Go Newtab" to the last line I have a similar issue. Otherwise not.

Win 11 64 bit.

Sorry, but is there any update about how to get this to run in Opus? All i can achieve ist to have an Everything instance opening*, but isn't it supposed to open in Opus somehow? I have tried several code snippets from this thread, but none of them actually worked. The only one which halfways works writes "wfn:ets.js.*" into every search mask, so it doesn't seem quite right yet.

** using the etsmenu.dcf button from this thread

I guess it's the other way round: DO is supposed to open or use Everything. At least this is how it work on my PC with DO and the button script from this thread.