Looking for Help Setting Up Middle-Mouse Button to Delete Selected Items

My goal is to have MMB* delete selected file(s) and folder(s).

(*Middle Mouse Button)

I've got this 99% working via these settings:

The tiny problem is that it won't delete All files in the selection, just the one under the cursor if hovering over selected files. Or, if hovering the window background, all of them. I want all selected items to be deleted no matter where the cursor is.

Delete on its own is better than Delete {allfile$}, since it applies to the selection by default automatically.

The main issue here is that the double-click events inherently only apply to the file that was double-clicked, not to all files.

You can override that with a small script:

@language jscript
function OnClick(clickData)
{
	var cmd = clickData.func.command;
	cmd.deselect = false;
	cmd.ClearFiles();
	cmd.AddFiles(clickData.func.sourcetab.selected);
	cmd.RunCommand("Delete");
}
2 Likes

What a fantastic program this is - and team behind it. Can't even find words to describe the excellence of GP Software and Directory Opus. In particular, your support, @Leo, has always been next level.

I'd like to chime in on previous requests for optionally disabling MMB-selection. In my case (using Single or Double MMB-click to delete selection) it would prevent the risk of selecting an extra item before the operation.

It's coming.

2 Likes