Custom Open Commands

Discussion related to "Everything" 1.5 Alpha.
tuska
Posts: 1098
Joined: Thu Jul 13, 2017 9:14 am

Re: Custom Open Commands

Post by tuska »

2void
Unfortunately, these commands no longer work in Everything 1.5.0.1384a+
EDIT: CODE works(!) - please see solution here.

custom_open_commands

Code: Select all

[{"name":"IrfanView","type":"2","filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\"C:\\totalcmd\\Tools\\IrfanView-portable-64bit\\IrfanView\\i_view64.exe\" \"%1\")"},{"name":"MPC-HC64","type":"2","filter":"*.mp4;*.mov","command":"$exec(\"C:\\Program Files $(x86$)\\K-Lite Codec Pack\\MPC-HC64\\mpc-hc64.exe\" \"%1\")"},{"name":"TC","type":"2","filter":"*.7z;*.zip","command":"$exec(\"C:\\totalcmd\\Totalcmd64.exe\" /O /A /S \"%1\")"}]
Please help.

[{"name":"IrfanView","type":"2","filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\"C:\\totalcmd\\Tools\\IrfanView-portable-64bit\\IrfanView\\i_view64.exe\" \"%1\")"},{"name":"MPC-HC64","type":"2","filter":"*.mp4;*.mov","command":"$exec(\"C:\\Program Files $(x86$)\\K-Lite Codec Pack\\MPC-HC64\\mpc-hc64.exe\" \"%1\")"},{"name":"TC","type":"2","filter":"*.7z;*.zip","command":"$exec(\"C:\\totalcmd\\Totalcmd64.exe\" /O /A /S \"%1\")"}]

________________________________________
Tag
EN: Internal Associations (Everything Only)
DE: Interne Verknüpfungen (nur in Everything)
Last edited by tuska on Sun Dec 01, 2024 3:35 pm, edited 1 time in total.
NotNull
Posts: 5517
Joined: Wed May 24, 2017 9:22 pm

Re: Custom Open Commands

Post by NotNull »

Describe "no longer work" ...

Tested (v1385a) with the following, which is basically your setting with different paths (to programs that exists my system):
Context menu entry Irfanview opens .jpg files
Context menu entry MPC-HC64opens opens .jmp4 files
Context menu entry TC opens opens .7z files

Code: Select all

[{"name":"IrfanView","type":"2","filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\""C:\\Tools\\voidImageViewer.exe"\" \"%1\")"},{"name":"MPC-HC64","type":"2","filter":"*.mp4;*.mov","command":"$exec(\"C:\\Tools\\vlc\\vlc.exe\" \"%1\")"},{"name":"TC","type":"2","filter":"*.7z;*.zip","command":"$exec(\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\")"}]
void
Developer
Posts: 17149
Joined: Fri Oct 16, 2009 11:31 pm

Re: Custom Open Commands

Post by void »

I will consider saving the table editor column positions and widths.

I will also consider making these columns auto fit when first shown.

Thank you for the suggestion.
tuska
Posts: 1098
Joined: Thu Jul 13, 2017 9:14 am

Re: Custom Open Commands

Post by tuska »

tuska wrote: Sat Nov 30, 2024 2:05 pm 2void
Unfortunately, these commands no longer work in Everything 1.5.0.1384a+
NotNull wrote: Sat Nov 30, 2024 7:38 pm Tested (v1385a) with the following, which is basically your setting with different paths (to programs that exists my system):
Context menu entry Irfanview opens .jpg files
Context menu entry MPC-HC64opens opens .jmp4 files
Context menu entry TC opens opens .7z files
I'm very sorry, I mistakenly assumed that, for example, double-clicking on a .PSD file in Everything would open it in IrfanView :?
(In Total Commander there is such a function ... and that confused me).

In Everything, opening a .PSD file with the setting in Advanced > custom_open_commands works via the context menu.
I.e. the CODE is still VALID!
void wrote: Sat Nov 30, 2024 9:16 pm I will consider saving the table editor column positions and widths.
I will also consider making these columns auto fit when first shown.
Thank you in advance for your efforts.
void
Developer
Posts: 17149
Joined: Fri Oct 16, 2009 11:31 pm

Re: Custom Open Commands

Post by void »

I'm very sorry, I mistakenly assumed that, for example, double-clicking on a .PSD file would open it in IrfanView :?
Remove the name or add a duplicated name-less entry:

Everything will use the name-less command as the default command. (open)
Otherwise, the command is shown in the right click context menu.

Code: Select all

[{"name":"","type":"2","filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\""C:\\Tools\\voidImageViewer.exe"\" \"%1\")"},{"name":"MPC-HC64","type":"2","filter":"*.mp4;*.mov","command":"$exec(\"C:\\Tools\\vlc\\vlc.exe\" \"%1\")"},{"name":"TC","type":"2","filter":"*.7z;*.zip","command":"$exec(\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\")"}]
(removed IrfanView name)

-or-

Code: Select all

[{"name":"","type":"2","filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\""C:\\Tools\\voidImageViewer.exe"\" \"%1\")"},{"name":"IrfanView","type":"2","filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\""C:\\Tools\\voidImageViewer.exe"\" \"%1\")"},{"name":"MPC-HC64","type":"2","filter":"*.mp4;*.mov","command":"$exec(\"C:\\Tools\\vlc\\vlc.exe\" \"%1\")"},{"name":"TC","type":"2","filter":"*.7z;*.zip","command":"$exec(\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\")"}]
(duplicated IrfanView without a name)
tuska
Posts: 1098
Joined: Thu Jul 13, 2017 9:14 am

Re: Custom Open Commands

Post by tuska »

2void

Wow, I removed the name “IrfanView” ("name":"",...) from the code and it immediately worked as follows:

Code: Select all

[{"name":"","type":"2","filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\"C:\\totalcmd\\Tools\\IrfanView-portable-64bit\\IrfanView\\i_view64.exe\" \"%1\")"},{"name":"MPC-HC64","type":"2","filter":"*.mp4;*.mov","command":"$exec(\"C:\\Program Files $(x86$)\\K-Lite Codec Pack\\MPC-HC64\\mpc-hc64.exe\" \"%1\")"},{"name":"","type":"2","filter":"*.7z;*.zip","command":"$exec(\"C:\\totalcmd\\Totalcmd64.exe\" /O /A /S \"%1\")"}]
1. Double-clicking the .PSD file in Everything 1.5.0.1385a (x64) opened the file in IrfanView.
2. Right-clicking   the .PSD file in Everything 1.5.0.1385a (x64) and clicking the “Open” context menu item also opened the file in IrfanView.

Thanks for the tip!
________________________________________________
{"name":"","type":"2","filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\"C:\\totalcmd\\Tools\\IrfanView-portable-64bit\\IrfanView\\i_view64.exe\" \"%1\")"},{"name":"MPC-HC64","type":"2","filter":"*.mp4;*.mov","command":"$exec(\"C:\\Program Files $(x86$)\\K-Lite Codec Pack\\MPC-HC64\\mpc-hc64.exe\" \"%1\")"},{"name":"","type":"2","filter":"*.7z;*.zip","command":"$exec(\"C:\\totalcmd\\Totalcmd64.exe\" /O /A /S \"%1\")"}]
tuska
Posts: 1098
Joined: Thu Jul 13, 2017 9:14 am

Re: Custom Open Commands

Post by tuska »

2void
void wrote: Sat Nov 30, 2024 11:37 pm -or-

Code: Select all

[{"name":"","type":"2","filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\""C:\\Tools\\voidImageViewer.exe"\" \"%1\")"},{"name":"IrfanView","type":"2","filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\""C:\\Tools\\voidImageViewer.exe"\" \"%1\")"},{"name":"MPC-HC64","type":"2","filter":"*.mp4;*.mov","command":"$exec(\"C:\\Tools\\vlc\\vlc.exe\" \"%1\")"},{"name":"TC","type":"2","filter":"*.7z;*.zip","command":"$exec(\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\")"}]
(duplicated IrfanView without a name)
I tried the “-or-” option, hoping that “IrfanView” would appear in the context menu
(and a .PSD file could also be opened by double-clicking in IrfanView). Unfortunately, so far without success.

I tried these three variations, but I couldn't get the “IrfanView” context menu entry to appear:

Code: Select all

[{"name":"","type":"2","filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\"C:\\totalcmd\\Tools\\IrfanView-portable-64bit\\IrfanView\\i_view64.exe\" \"%1\")"},"name":"IrfanView","type":"2","filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\"C:\\totalcmd\\Tools\\IrfanView-portable-64bit\\IrfanView\\i_view64.exe\" \"%1\")"},{"name":"MPC-HC64","type":"2","filter":"*.mp4;*.mov","command":"$exec(\"C:\\Program Files $(x86$)\\K-Lite Codec Pack\\MPC-HC64\\mpc-hc64.exe\" \"%1\")"},{"name":"","type":"2","filter":"*.7z;*.zip","command":"$exec(\"C:\\totalcmd\\Totalcmd64.exe\" /O /A /S \"%1\")"}]

Code: Select all

[{"name":"IrfanView","type":"2","filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\"C:\\totalcmd\\Tools\\IrfanView-portable-64bit\\IrfanView\\i_view64.exe\" \"%1\")"},"name":"","type":"2","filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\"C:\\totalcmd\\Tools\\IrfanView-portable-64bit\\IrfanView\\i_view64.exe\" \"%1\")"},{"name":"MPC-HC64","type":"2","filter":"*.mp4;*.mov","command":"$exec(\"C:\\Program Files $(x86$)\\K-Lite Codec Pack\\MPC-HC64\\mpc-hc64.exe\" \"%1\")"},{"name":"","type":"2","filter":"*.7z;*.zip","command":"$exec(\"C:\\totalcmd\\Totalcmd64.exe\" /O /A /S \"%1\")"}]

Code: Select all

[{"name":"IrfanView","type":"2","filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\"C:\\totalcmd\\Tools\\IrfanView-portable-64bit\\IrfanView\\i_view64.exe\" \"%1\")","name":"","type":"2","filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\"C:\\totalcmd\\Tools\\IrfanView-portable-64bit\\IrfanView\\i_view64.exe\" \"%1\")"},{"name":"MPC-HC64","type":"2","filter":"*.mp4;*.mov","command":"$exec(\"C:\\Program Files $(x86$)\\K-Lite Codec Pack\\MPC-HC64\\mpc-hc64.exe\" \"%1\")"},{"name":"","type":"2","filter":"*.7z;*.zip","command":"$exec(\"C:\\totalcmd\\Totalcmd64.exe\" /O /A /S \"%1\")"}]
Please help.
NotNull
Posts: 5517
Joined: Wed May 24, 2017 9:22 pm

Re: Custom Open Commands

Post by NotNull »

tuska wrote: Sun Dec 01, 2024 11:52 am 2void
I tried these three variations, but I couldn't get the “IrfanView” context menu entry to appear:

Code: Select all

[{"name":"","type":"2","filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\"C:\\totalcmd\\Tools\\IrfanView-portable-64bit\\IrfanView\\i_view64.exe\" \"%1\")"},"name":"IrfanView","type":"2","filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\"C:\\totalcmd\\Tools\\IrfanView-portable-64bit\\IrfanView\\i_view64.exe\" \"%1\")"},{"name":"MPC-HC64","type":"2","filter":"*.mp4;*.mov","command":"$exec(\"C:\\Program Files $(x86$)\\K-Lite Codec Pack\\MPC-HC64\\mpc-hc64.exe\" \"%1\")"},{"name":"","type":"2","filter":"*.7z;*.zip","command":"$exec(\"C:\\totalcmd\\Totalcmd64.exe\" /O /A /S \"%1\")"}]
Only void may respond?

Anyway, there's a curly bracket missing in your first JSON, second entry:
,"name":"IrfanView","
should be:
,{"name":"IrfanView","


So try the following instead:

Code: Select all

[{"name":"","type":"2","filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\"C:\\totalcmd\\Tools\\IrfanView-portable-64bit\\IrfanView\\i_view64.exe\" \"%1\")"},{"name":"IrfanView","type":"2","filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\"C:\\totalcmd\\Tools\\IrfanView-portable-64bit\\IrfanView\\i_view64.exe\" \"%1\")"},{"name":"MPC-HC64","type":"2","filter":"*.mp4;*.mov","command":"$exec(\"C:\\Program Files $(x86$)\\K-Lite Codec Pack\\MPC-HC64\\mpc-hc64.exe\" \"%1\")"},{"name":"","type":"2","filter":"*.7z;*.zip","command":"$exec(\"C:\\totalcmd\\Totalcmd64.exe\" /O /A /S \"%1\")"}]

tuska
Posts: 1098
Joined: Thu Jul 13, 2017 9:14 am

Re: Custom Open Commands

Post by tuska »

NotNull wrote: Sun Dec 01, 2024 1:10 pm Only void may respond?
No, I didn't mean it like that at all.
I always welcome your expertise! :)
NotNull wrote: Sun Dec 01, 2024 1:10 pm So try the following instead: ...
Thank you very much! Many thanks also to void!
Your code works perfectly! :)

Menu "Tools" > Options... > Advanced > Show settings containing: custom > custom_open_commands > Value for custom_open_commands:

Code: Select all

[[{"name":"","type":"2","filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\"C:\\totalcmd\\Tools\\IrfanView-portable-64bit\\IrfanView\\i_view64.exe\" \"%1\")"},{"name":"IrfanView","type":"2","filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\"C:\\totalcmd\\Tools\\IrfanView-portable-64bit\\IrfanView\\i_view64.exe\" \"%1\")"},{"name":"MPC-HC64","type":"2","filter":"*.mp4;*.mov","command":"$exec(\"C:\\Program Files $(x86$)\\K-Lite Codec Pack\\MPC-HC64\\mpc-hc64.exe\" \"%1\")"},{"name":"","type":"2","filter":"*.7z;*.zip","command":"$exec(\"C:\\totalcmd\\TOTALCMD64.EXE\" /O /A /S \"%1\")"}]
This makes the following possible:
1. Double-clicking a .PSD file, e.g. in Everything 1.5.0.1385a (x64) to open the file in IrfanView.
   - OR -
2. Right-clicking   a .PSD file, e.g. in Everything 1.5.0.1385a (x64) and clicking the “IrfanViewcontext menu item to open the file in IrfanView.
________________________________________________
[{"name":"","type":"2","filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\"C:\\totalcmd\\Tools\\IrfanView-portable-64bit\\IrfanView\\i_view64.exe\" \"%1\")"},{"name":"IrfanView","type":"2","filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\"C:\\totalcmd\\Tools\\IrfanView-portable-64bit\\IrfanView\\i_view64.exe\" \"%1\")"},{"name":"MPC-HC64","type":"2","filter":"*.mp4;*.mov","command":"$exec(\"C:\\Program Files $(x86$)\\K-Lite Codec Pack\\MPC-HC64\\mpc-hc64.exe\" \"%1\")"},{"name":"","type":"2","filter":"*.7z;*.zip","command":"$exec(\"C:\\totalcmd\\TOTALCMD64.EXE\" /O /A /S \"%1\")"}]
_________________________________________________________________________________________________________

Notes: (Total Commander)

This code (in the last row above) sets the focus to a .7z or .zip file in the active Total Commander panel:
[{"name":"","type":"2","filter":"*.7z;*.zip","command":"$exec(\"C:\\totalcmd\\TOTALCMD64.EXE\" /O /A /S \"%1\")"}]
- after double-clicking the .7z or .zip file, e.g. in Everything 1.5.0.1385a (x64)
- after right-clicking the .7z or .zip file and selecting “Open” from the context menu, e.g. in Everything 1.5.0.1385a (x64)
- after double-clicking the path in Everything 1.5.0.1385a (x64) - SETTING needed (adjust the path if necessary ...):
           Everything Options - 1.5.0.1385a (x64) > Context Menu > Open Path > $exec("C:\totalcmd\TOTALCMD64.EXE" /O /A /S "%1")

This code opens a .7z or .ZIP file in the active Total Commander panel:
[{"name":"","type":"2","filter":"*.7z;*.zip","command":"$exec(\"C:\\totalcmd\\TOTALCMD64.EXE\" /O /S \"%1\")"}]
- after double-clicking the .7z or .zip file, e.g. in Everything 1.5.0.1385a (x64)
- after right-clicking the .7z or .zip file and selecting “Open” from the context menu, e.g. in Everything 1.5.0.1385a (x64)

- AND -

additionally this code can be used to set the focus to a .7z or .zip file in the active Total Commander panel
- after double-clicking the path in Everything 1.5.0.1385a (x64) - SETTING needed (adjust the path if necessary ...):
           Everything Options - 1.5.0.1385a (x64) > Context Menu > Open Path > $exec("C:\totalcmd\TOTALCMD64.EXE" /O /A /S "%1")

This code opens a .7z or .ZIP file in File Explorer:
(This code is generally NOT needed for File Explorer, but only in connection with Total Commander).
[{"name":"Totalcmd","type":"2","filter":"*.7z;*.zip","command":"$exec(\"C:\\totalcmd\\TOTALCMD64.EXE\" /O /A /S \"%1\")"}]
- after double-clicking the .7z or .zip file, e.g. in Everything 1.5.0.1385a (x64)

- AND -

the same code sets the focus to a .7z or .zip file in the active Total Commander panel
- after right-clicking the .7z or .zip file and selecting “Totalcmd” from the context menu, e.g. in Everything 1.5.0.1385a (x64)
- after double-clicking the path in Everything 1.5.0.1385a (x64) - SETTING needed (adjust the path if necessary ...):
           Everything Options - 1.5.0.1385a (x64) > Context Menu > Open Path > $exec("C:\totalcmd\TOTALCMD64.EXE" /O /A /S "%1")

__________________________________________________________________________________
Tags: EN: Internal Associations (Everything Only), DE: Interne Verknüpfungen (nur in Everything)
Windows 11 Pro (x64) Version 24H2 (OS Build 26100.2454) - 2024-11-21
NotNull
Posts: 5517
Joined: Wed May 24, 2017 9:22 pm

Re: Custom Open Commands

Post by NotNull »

tuska wrote: Sun Dec 01, 2024 2:10 pm by tuska » 01 Dec 2024, 15:10

NotNull wrote: ↑01 Dec 2024, 14:10
Only void may respond?

No, I didn't mean it like that at all.
I know you didn't / don't. Should have added a: ;) ...
dedupeit
Posts: 29
Joined: Thu Jul 28, 2022 9:52 pm

Re: Custom Open Commands

Post by dedupeit »

Is there a way to pass all of the results to the command, as opposed to all of the selected files? I going through a workflow where the search results in a small number of files (2 to 10 files as an example). And then I want to run a command against all of the files in the search results.
void
Developer
Posts: 17149
Joined: Fri Oct 16, 2009 11:31 pm

Re: Custom Open Commands

Post by void »

Use
%*
instead of
%1


%*
is replaced with all the selected filenames (space separated)
With
%*
, the command is executed only once.
dedupeit
Posts: 29
Joined: Thu Jul 28, 2022 9:52 pm

Re: Custom Open Commands

Post by dedupeit »

Hey void, thanks for the response. I was actually asking if there was a way to send the list of results as opposed to just the selected files. But I'm using a number of tools to automate my workflow and I've got this taken care of using a different approach :)

BTW, I keep creating things using my suite of tools only to find out that you've already built it into Everything! There so much this does that I don't think I'll ever know it all. Thanks for the great work!
void
Developer
Posts: 17149
Joined: Fri Oct 16, 2009 11:31 pm

Re: Custom Open Commands

Post by void »

Everything 1.5.0.1388a improves custom open commands.

type has been replaced with include_folders and include_files.
description has been added and is shown in the status bar when you hover over this command in the context menu.

Context menu commands have also been improved in this version.
Post Reply