Add command to "To clipboard"

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Alon
Posts: 12
Joined: 27 Nov 2015 07:34

Add command to "To clipboard"

Post by Alon »

Hi,

How can I add a command to the "To clipboard" context menu?

I want to execute this script:

Code: Select all

copytext replace("<curitem>", "\", "/") 
when I need to copy a path in windows to run in python.

Meanwhile I added a "user button" to the toolbar...

Thanks,
Alon
Win11, Scaling is 125%

highend
Posts: 14577
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Add command to "To clipboard"

Post by highend »

You can't add user defined commands to that submenu, why don't you use a user defined command and use a keyboard shortcut for it?
One of my scripts helped you out? Please donate via Paypal

Alon
Posts: 12
Joined: 27 Nov 2015 07:34

Re: Add command to "To clipboard"

Post by Alon »

Because I have already ton of keyboard shortcuts for tens of actions all over (I'm also heavy on AHK) and that is not that common task for me so I cannot "waste" a shortcut on it.

So @Admin, please add the ability to edit these menus to the wish list ;)

Thanks.
Alon
Win11, Scaling is 125%

WirlyWirly
Posts: 273
Joined: 21 Oct 2020 23:33
Location: Win 10 @ 100% (3440x1440)

Re: Add command to "To clipboard"

Post by WirlyWirly »

Since it sounds like you're big on shortcuts, have you ever used a modal text-editor, such as Vim?

The idea is that when writing code, most of your time is spent navigating and moving your code around, not actually inputting text as one would believe. Therefore, having the "r" key only send the letter "r" at all times is a waste of a good shortcut.

Instead, the "r" key should do something more useful by default, and only when you are focused on an input-field should it actually send the letter "r". We call this behavior "modal", meaning that each key will do a different thing depending on what "mode" you are in.

That same principle can be applied to other programs, such as XY, where only a fraction of our time is spent actually typing text into an input-field; it's a waste of easy shortcuts to let every letter/number/symbol on your keyboard be useless the rest of the time.

For example, using an AHK script and XY's amazing Keybinding customization, my workflow is such that when I press the "r" key, it will perform an inline-"rename" on the item I've selected, which means AHK detects the input-field and starts sending letters like normal. Likewise, pressing "shift+r" will run highends ColumnEdit "renaming" script so that I can batch-rename files from my text-editor. I like to use mnemonic shortcuts like this whenever I can, but it's not necessary.

When I press the "m" key, it will show a scripted popup-"menu" of my most used shortcuts and actions. Pretty much everything and more that I would put in a toolbar/catalog. Then, pressing "shift+m" I use to run a script that contains a custom right-click "menu".

For navigation, outside of the MainMenu/config I don't even use my mouse, I use Vim's defaults; "h", "j", "k", "l", "ctrl+f", "ctrf+b", "ctrl+u", "ctrl+d", "shift+g", "g" then "g", etc.

I can also do "leader keys", which adds a whole other layer of possible shortcuts, such as; "space" then "r", "space" then "2", etc

These shortcuts might seem unintuitive, but that's because I based them on Vim's defaults that I've been using for years, so for me they make complete sense.

Basically, by implementing "modal" shortcuts with AHK, every letter/number/symbol on your keyboard suddenly frees up so that it can be used to assign a shortcut. You can even do layers of shortcuts if you include the modifier keys such as "shift", "ctrl", "alt", double-taps, and "leader" keys.

The only downside to this approach is that because I've automated the detection of input-fields, you can't jump to files by typing their name into the list. For that, I use "/" to focus on the live-filter box.

If you wanna check it out, I've attached my AHK script below, though keep in mind that not all my shortcuts will work for you because we may have different XY KeyBindings. Line #140 is where the modal-shortcuts begin.

Vim-Like.zip
(117.64 KiB) Downloaded 32 times

klownboy
Posts: 4398
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440

Re: Add command to "To clipboard"

Post by klownboy »

Hi WirlyWirly (Wirlyx2), I use AHK along with XYplorer as well so I was very curious about this. I'm always looking for new shortcuts. When I normal left click to download Vim-Like.zip nothing happened I had to right click and open in a new tab to grab the file.

Just checked again...It appears the (left click) normal download is working now so I'm not sure what was going on - possibly a forum issue. Thanks.

Alon
Posts: 12
Joined: 27 Nov 2015 07:34

Re: Add command to "To clipboard"

Post by Alon »

@WirlyWirly, thanks for your very explanatory reply. Certainly an interesting idea. Will test it soon. Cheers.
Alon
Win11, Scaling is 125%

Post Reply