function OnClick(clickData)
{
var cmd = clickData.func.command;
cmd.deselect = false;
cmd.ClearFiles();
for (var eSel = new Enumerator(clickData.func.sourcetab.selected); !eSel.atEnd(); eSel.moveNext())
{
if (!eSel.item().is_dir && eSel.item().ext != "")
{
cmd.RunCommand('Select PATTERN="*' + eSel.item().ext + '"');
}
}
}
XML for pasting to a toolbar:
<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" textcol="none">
<label>New Button</label>
<icon1>#newcommand</icon1>
<function type="script">
<instruction>@script JScript</instruction>
<instruction>function OnClick(clickData)</instruction>
<instruction>{</instruction>
<instruction> var cmd = clickData.func.command;</instruction>
<instruction> cmd.deselect = false;</instruction>
<instruction> cmd.ClearFiles();</instruction>
<instruction> for (var eSel = new Enumerator(clickData.func.sourcetab.selected); !eSel.atEnd(); eSel.moveNext())</instruction>
<instruction> {</instruction>
<instruction> if (!eSel.item().is_dir && eSel.item().ext != "")</instruction>
<instruction> {</instruction>
<instruction> cmd.RunCommand('Select PATTERN="*' + eSel.item().ext + '"');</instruction>
<instruction> }</instruction>
<instruction> }</instruction>
<instruction>}</instruction>
</function>
</button>