Add custom commands to context menu ?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
CookieMonster

Add custom commands to context menu ?

Post by CookieMonster »

How do you add the ability to right click in XY on a file and a context window displays a custom command and all the options available in the command ?


CookieMonster

Re: Add custom commands to context menu ?

Post by CookieMonster »

Since it is a wish, it can't be done, that is what you're telling me, correct ?

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Add custom commands to context menu ?

Post by bdeshi »

You can't customize the file context menu, but recently we've been granted the power to completely redesign the context menu that appears when you right click the whitespace/emptyarea of the list. Here's the discussion. (hint: it's a tweak. you have to open XY's ini file, find a key and change it's value)
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

CookieMonster

Re: Add custom commands to context menu ?

Post by CookieMonster »

I don't want to redesign the context menu. I have a command line command that has a few options, I want to have the command as well as the options listed in the context menu, instead of loading a command prompt and triggering the option, I simply select the file, right-click, choose the command, choose an option of the command and run.

Stef123

Re: Add custom commands to context menu ?

Post by Stef123 »

CookieMonster wrote: Since it is a wish, it can't be done, that is what you're telling me, correct ?
Well, no hidden messages, actually. Just letting you know I'm all for it, and there's a workaround via Open With that's almost as good. Requires one additional click, though, and you have to remember that "Open With..." actually means "My custom commands", and you cannot have separators unless you call yet another script which then presents your custom menu commands.

I have it set up this way. It takes 3 clicks to get to my custom context menu, so I use accelerator keys to jump from branch to branch. Not exactly intuitive, but then I get to see my personalized context menu.

Example entry for your PFA:

Code: Select all

|"My &Context Menu" \;*>::load "MyContextMenu.xys"
So after right-clicking a file, first you click on "Open with...", then you click on My Context Menu (or press C) - et voila - your list of commands, either by adding them as UDC or by writing them directly into MyContextMenu.xys

CookieMonster

Re: Add custom commands to context menu ?

Post by CookieMonster »

Stef - You can't do what you mentioned in any folder pane, you have to do a open with.. ? Can I see what you're talking about with screen shots or a short video ? :)

Stef123

Re: Add custom commands to context menu ?

Post by Stef123 »

CookieMonster wrote:Stef - You can't do what you mentioned in any folder pane, you have to do a open with.. ?
Exactly. Open with... is your "sesame open", the entry key. Enable it for right-clicks via
Config > Menus, Mouse, Safety > Files List... > #10

Unless you meant right-clicking an EMPTY spot in the folder pane? Then follow the link Sammay gave you.

CookieMonster

Re: Add custom commands to context menu ?

Post by CookieMonster »

Hi, open with strictly opens the file in which the file has an association; for example, if I select a notepad file, File > Open With.. it will prompt to open notepad. This is a command line program with command line options I want available by right clicking in any pane and accessing, not only the command line, in any pane, but all the options the command line offers.

Stef123 wrote:
CookieMonster wrote:Stef - You can't do what you mentioned in any folder pane, you have to do a open with.. ?
Exactly. Open with... is your "sesame open", the entry key. Enable it for right-clicks via
Config > Menus, Mouse, Safety > Files List... > #10

Unless you meant right-clicking an EMPTY spot in the folder pane? Then follow the link Sammay gave you.

Stef123

Re: Add custom commands to context menu ?

Post by Stef123 »

CookieMonster wrote:Hi, open with strictly opens the file in which the file has an association
Not my experience. I can right-click ANY file(s) or folder(s) then pick my custom menu from the Open with menu, then click Copy to other pane, for instance.
If you follow my example above it should work for you, too. Put your commands into a "MyContextMenu.xys" text file that you place inside \Data\Scripts. Then copy my line literally, including the pipe symbol and the backslash etc
CookieMonster wrote: command line options I want available by right clicking
Cannot help you with command line stuff. You have to ask a specific question and I am very confident the gurus around here can guide you towards scripting it. You then write this code into your "MyContextMenu.xys" and proceed as described above.

CookieMonster

Re: Add custom commands to context menu ?

Post by CookieMonster »

So after right-clicking a file, first you click on "Open with...", then you click on My Context Menu (or press C)
Right-click a file, followed by "Open with..." ?

I understand what you mean, as I'm trying to get your example working; as you mentioned it is a few too many clicks :)

Stef123

Re: Add custom commands to context menu ?

Post by Stef123 »

Yes, not an elegant workaround. It were nicer to see custom entries on the first click.
Also not logical :naughty: , to have your context menu as part of Open with..... - it should be the other way round. Or at least side by side, so you can place custom calls next to Open with ...

CookieMonster

Re: Add custom commands to context menu ?

Post by CookieMonster »

What other way around; I duplicated what you said to do ! :!:
Also not logical :naughty: , to have your context menu as part of Open with..... - it should be the other way round. Or at least side by side, so you can place custom calls next to Open with ...

Stef123

Re: Add custom commands to context menu ?

Post by Stef123 »

Just saying I support your original wish. You said our workaround requires "too many clicks". And I added it also turns things "around" - by bringing up the context menu under "Open with..." - instead of calling "Open with..." #176 from our context menu. :titter:

CookieMonster

Re: Add custom commands to context menu ?

Post by CookieMonster »

I'm not following what you're saying ?

Post Reply