Context Menu Commands

Discussion related to "Everything" 1.5 Alpha.
Post Reply
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Context Menu Commands

Post by void »

Everything context menu commands allow you to change the action Everything performs when you:
Open a file or folder.
Open a path.
Explore a file or folder.
Explore a path.



Changing a command might be useful for opening a third party file browser from Everything.
Total Commander - custom commands
Please share any custom commands here.



Commands can contain any of the following function calls:

$exec(filename)
Opens the specified filename with ShellExecute (as an ITEMIDLIST).
Example: $exec("%1")

$open-path(filename)
Opens the path to the specified filename in the default file browser.
Windows Explorer will also select the specified filename.
Example: $openpath("%1")

$parent(filename)
$path-part(filename)
Returns the path part of the specified filename.
Example: $exec("%SystemRoot%\explorer.exe" "$parent(%1)")

$name-part(filename)
$stem(filename)
Returns the name part (removes the path part and extension) of the specified filename.

$create-process(filename)
Opens the specified filename with CreateProcess.

$explore-in-everything(filename)
Opens the specified filename in the Everything folder sidebar.

$explore-path-in-everything(filename)
Opens the path of the specified filename in the Everything folder sidebar.

$exec-minimized(filename)
Opens the specified filename minimized with ShellExecute.

$exec-maximized(filename)
Opens the specified filename maximized with ShellExecute.

$close()
Close the current Everything window.

$minimize()
Minimize the current Everything window.

$shell-execute(filename)
Opens the specified filename with ShellExecute (as a filename).

$explore(filename)
Opens the specified filename with ShellExecute and the explore verb.

$open(filename)
Opens the specified filename with ShellExecute and the open verb.

$alert(message)
Show a dialog with the specified message.
Useful for debugging parameters.

$command(command-id)
Execute the specified UI command by Command ID.

$if(expression,true_statement,false_statement)
If expression is true, execute the true_statement. Otherwise, execute the false_statement.

%0
%1
The currently selected filename.

$$
A literal $.

$)
A literal ).


Dashes (-) in function names can be omitted.



Environment variables are automatically expanded.
The Everything Preprocessor can be used.



$property: is substituted with the property value.
For example: $size: is replaced with the file/folder size.
$online: is replaced with 1 if the file/folder is online and 0 if the file/folder is offline.



To change one of these actions:
  • In Everything, from the Tools menu, click Options.
  • Click the Context Menu tab on the left.
  • Select an item.
  • Set a new Command.
  • Click OK.


To restore defaults:
  • In Everything, from the Tools menu, click Options.
  • Click the Context Menu tab on the left.
  • Click Restore Defaults.
  • Click OK.


The default commands:

Open (Folders)
$exec("%1")

Open (Files)
$exec("%1")

Open Path
$openpath("%1")

Explore
$exec("%SystemRoot%\explorer.exe" /n,/e,"%1")

Explore Path
$exec("%SystemRoot%\explorer.exe" /n,/e,/select,"%1")




Additional context menu items can be created with Custom Open Commands
tuska
Posts: 1098
Joined: Thu Jul 13, 2017 9:14 am

Re: Everything Context Menu Commands

Post by tuska »

void wrote: Wed Apr 13, 2022 9:55 am ...
Changing a command might be useful for opening a third party file browser from Everything.
Please share any custom commands here.
...
Total Commander - custom commands
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: Everything Context Menu Commands

Post by void »

Everything 1.5.0.1311a adds support for dashes in function names (dashes can be omitted).
NotNull
Posts: 5517
Joined: Wed May 24, 2017 9:22 pm

Re: Everything Context Menu Commands

Post by NotNull »

Q-Dir (version 7.83 and up):

Code: Select all

Open (Folders) = $exec("c:\path to\Q-Dir_x64.exe" /e>>%1)
Open Path      = $exec("c:\path to\Q-Dir_x64.exe" /e,/select,"%1")
(with thanks to someone on the Listary forum) as this is largely undocumented and the Q-Dir author could not answer me this either).
NotNull
Posts: 5517
Joined: Wed May 24, 2017 9:22 pm

Re: Everything Context Menu Commands

Post by NotNull »

XYPlorer:

Code: Select all

Open (Folders) = $exec("C:\Program Files $(x86$)\XYplorer\XYplorer.exe" "%1")
Open Path      = $exec("C:\Program Files $(x86$)\XYplorer\XYplorer.exe" /select="%1")

void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: Context Menu Commands

Post by void »

Everything 1.5.0.1388a improves context menu commands.

Added the following functions:

$alert(message) - show a message dialog.
$command(command-id) - execute a UI command.
$if(expression,true_statement,false_statement) - execute commands on a condition.



$property: substitution is now supported.



$if() and $property: example usage:

$if($online:,$exec("%1"),$search-in-everything("%1"))


$exec("C:\scripts\My Program.exe" -filename "%1" -size $size: -is-folder $is-folder:)

$if($online:,$if([regexmatch:$extension:,(bmp|jpg|jpeg|png|gif|tif|tiff|jp2)],$exec("C:\MyScript1.exe" "%1"),$exec("%1")),$exec("C:\MyScript2.exe" "%1"))


) is now treated literally when inside quotes.

$exec("C:\Program Files $(x86$)\Everything\Everything.exe" -path "%1")

is now the same as:
$exec("C:\Program Files (x86)\Everything\Everything.exe" -path "%1")
Post Reply