Select ALLSMART (one shortcut for select all files/ all none toggle)

Great thanks :slight_smile:

edit: for special case 'recycle bin' selstats is not possible to use, so it's also possible to add a regular 'select all' behavior as default for recycle bin.

This is explained here : How do I enumerate files in the Recycle Bin?

modified code :

function OnClick(clickData)
{
	var cmd = clickData.func.command;
	cmd.deselect = false;

	var stats = clickData.func.sourcetab.selstats;

	if (clickData.func.sourcetab.path == "::{645FF040-5081-101B-9F08-00AA002F954E}") { // if recycle bin
		cmd.RunCommand("Select ALL");
	}
	else if (stats.dirs == stats.seldirs && stats.files == stats.selfiles) {
		cmd.RunCommand("Select NONE");
	}
	else if (stats.dirs == stats.seldirs || stats.files == stats.selfiles) {
		cmd.RunCommand("Select ALL");
	}
	else if (stats.files != stats.selfiles) {
		cmd.RunCommand("Select ALLFILES");
	}
}