Select All / Select Nothing button

I was trying to create a button with the following code, but it doesn't work:

@ifset: Select NONE
SelectAll
@ifset:else
Select NONE

Does anyone know how to write a script for this purpose?

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

	if (clickData.func.sourcetab.selected.count == clickData.func.sourcetab.all.count)
	{
		cmd.RunCommand("Select NONE");
	}
	else
	{
		cmd.RunCommand("Select ALL");
	}
}
1 Like

Thank you very much @Leo , my admiration and respect for you grows more every day!

1 Like