# EverythingInterface

If [Everything](https://chaoses-ib.gitbook.io/directory-opus/manual/additional_functionality/everything_integration) by voidtools is installed, this provides an interface that lets you easily communicate with Everything from a script. You can start and stop Everything, query its status, send it arbitrary commands and query its database.

Create an **EverythingInterface** object via the [**DOpus**](https://chaoses-ib.gitbook.io/directory-opus/manual/reference/scripting_reference/scripting_objects/dopus)**.Create** factory method.

| Property Name | Return Type                                                                                                                             | Description                                                                                                                                                                                                                                      |                                                  |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------ |
| autorun       | *bool*                                                                                                                                  | Returns True if Everything is configured to auto-start (via the [**Miscellaneous / Advanced Options**](https://chaoses-ib.gitbook.io/directory-opus/manual/preferences/preferences_categories/miscellaneous/advanced_options) Preferences page). |                                                  |
| indexed       | *int*                                                                                                                                   | <p>Returns a value indicating which attributes Everything is configured to index. This is a bitmask made up of the following values:</p><p><em>bool</em></p>                                                                                     | Returns True if Everything is currently running. |
|               |                                                                                                                                         |                                                                                                                                                                                                                                                  |                                                  |
| 2             | File sizes                                                                                                                              |                                                                                                                                                                                                                                                  |                                                  |
| 4             | Folder sizes                                                                                                                            |                                                                                                                                                                                                                                                  |                                                  |
| 8             | Created date                                                                                                                            |                                                                                                                                                                                                                                                  |                                                  |
| 16            | Modified date                                                                                                                           |                                                                                                                                                                                                                                                  |                                                  |
| 32            | Accessed date                                                                                                                           |                                                                                                                                                                                                                                                  |                                                  |
| 64            | Attributes                                                                                                                              |                                                                                                                                                                                                                                                  |                                                  |
|               |                                                                                                                                         |                                                                                                                                                                                                                                                  |                                                  |
|               |                                                                                                                                         |                                                                                                                                                                                                                                                  |                                                  |
| isrunning     |                                                                                                                                         |                                                                                                                                                                                                                                                  |                                                  |
| roots         | *object:*[**StringSet**](https://chaoses-ib.gitbook.io/directory-opus/manual/reference/scripting_reference/scripting_objects/stringset) | Returns a set representing the drive roots that Everything has indexed.                                                                                                                                                                          |                                                  |
| version       | *string*                                                                                                                                | Returns Everything's version number.                                                                                                                                                                                                             |                                                  |

| Method Name | **Arguments**                                                                                                           | Return Type                                                                                                                                                                                                                                                              | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ----------- | ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Indexed     | \<string:path>                                                                                                          | *bool*                                                                                                                                                                                                                                                                   | Returns True if the specified path is indexed by Everything.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Query       | <p>\<query><br>\<search\_flags><br>\<request\_flags><br>\<sort\_type><br>\<max\_results><br>\<offset><br>\<timeout></p> | [**Vector**](https://chaoses-ib.gitbook.io/directory-opus/manual/reference/scripting_reference/scripting_objects/vector) of [**EverythingResult**](https://chaoses-ib.gitbook.io/directory-opus/manual/reference/scripting_reference/scripting_objects/everythingresult) | <p>Sends the specified query string to Everything. Returns the results as a <a href="vector">Vector</a> of <a href="everythingresult">EverythingResult</a> objects.</p><p>All arguments after the query string are optional, and represent flags provided by the Everything API.</p><p><em>search\_flags</em> should be a bitmask representing the <code>EVERYTHING\_IPC\_xxx</code> search flags, or a string containing one or more of the following characters. Defaults to <code>0</code> if not provided.</p><p><em>request\_flags</em> should be a bitmask representing the <code>EVERYTHING\_IPC\_QUERY2\_REQUEST\_xxx</code> request flags, or a string containing one or more of the following characters. Defaults to <code>EVERYTHING\_IPC\_QUERY2\_REQUEST\_FULL\_PATH\_AND\_NAME</code> if not provided.</p><p><em>sort\_type</em> should be one of the <code>EVERYTHING\_IPC\_SORT\_xxx</code> constants (the numeric value). Defaults to <code>0</code> if not provided.</p><p><em>max\_results</em> lets you limit the number of results returned. Defaults to the <em>everything\_max\_results</em> advanced Preferences value if not provided.</p><p><em>offset</em> specifies the result offset. In conjunction with <em>max\_results</em> this lets you query large datasets without having to deal with all the results at once.</p><p><em>timeout</em> specifies a timeout in milliseconds. Defaults to <code>1000</code> if not provided.</p> |
|             |                                                                                                                         |                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| c           | match case (`EVERYTHING_IPC_MATCHCASE`)                                                                                 |                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| w           | match whole words (`EVERYTHING_IPC_MATCHWHOLEWORDS`)                                                                    |                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| p           | match path (`EVERYTHING_IPC_MATCHPATH`)                                                                                 |                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| r           | regex (`EVERYTHING_IPC_REGEX`)                                                                                          |                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| a           | match accents (`EVERYTHING_IPC_MATCHACCENTS`)                                                                           |                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
|             |                                                                                                                         |                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| n           | name (`EVERYTHING_IPC_QUERY2_REQUEST_NAME`)                                                                             |                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| p           | path (`EVERYTHING_IPC_QUERY2_REQUEST_PATH`)                                                                             |                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| f           | full path and name (`EVERYTHING_IPC_QUERY2_REQUEST_FULL_PATH_AND_NAME`)                                                 |                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| x           | extension (`EVERYTHING_IPC_QUERY2_REQUEST_EXTENSION`)                                                                   |                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| s           | size (`EVERYTHING_IPC_QUERY2_REQUEST_SIZE`)                                                                             |                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| c           | created (`EVERYTHING_IPC_QUERY2_REQUEST_DATE_CREATED`)                                                                  |                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| m           | modified (`EVERYTHING_IPC_QUERY2_REQUEST_DATE_MODIFIED`)                                                                |                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| e           | accessed (`EVERYTHING_IPC_QUERY2_REQUEST_DATE_ACCESSED`)                                                                |                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| a           | attributes (`EVERYTHING_IPC_QUERY2_REQUEST_ATTRIBUTES`)                                                                 |                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| r           | run count (`EVERYTHING_IPC_QUERY2_REQUEST_RUN_COUNT`)                                                                   |                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| R           | date run (`EVERYTHING_IPC_QUERY2_REQUEST_DATE_RUN`)                                                                     |                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| M           | date recently changed (`EVERYTHING_IPC_QUERY2_REQUEST_DATE_RECENTLY_CHANGED`)                                           |                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| N           | highlighted name (`EVERYTHING_IPC_QUERY2_REQUEST_HIGHLIGHTED_NAME`)                                                     |                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| P           | highlighted path (`EVERYTHING_IPC_QUERY2_REQUEST_HIGHLIGHTED_PATH`)                                                     |                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| F           | highlighted full path and name (`EVERYTHING_IPC_QUERY2_REQUEST_HIGHLIGHTED_FULL_PATH_AND_NAME`)                         |                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| RunCountGet | \<string:file>                                                                                                          | *int*                                                                                                                                                                                                                                                                    | Returns the run count for the specified file.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| RunCountInc | \<string:file>                                                                                                          | *int*                                                                                                                                                                                                                                                                    | Increments the run count for the specified file and returns the new count.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| RunCountSet | <p>\<string:file><br>\<int:count></p>                                                                                   | *bool*                                                                                                                                                                                                                                                                   | Sets the run count for the specified file to the value provided. Returns True on success.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| SendCmd     | <p>\<int:command><br>\[\<int:data>]</p>                                                                                 | *int*                                                                                                                                                                                                                                                                    | Sends the specified command to Everything and returns its response. The commands are documented in the Everything API SDK (e.g. 401 equates to `EVERYTHING_IPC_IS_DB_LOADED` and returns 1 to indicate Everything's database is loaded).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| Start       | *none*                                                                                                                  | *bool*                                                                                                                                                                                                                                                                   | Starts Everything if it's not already running and Opus has been configured to auto-start it.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Stop        | *none*                                                                                                                  | *bool*                                                                                                                                                                                                                                                                   | Stops Everything (tells it to quit).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
