Select images and videos in dual display mode?

Hi everyone,
I would like to select only images in upper display and only videos in the lower display using the same folder. Currently I'm using two folders for that purpose with go command:
Go ".\Images" DUALPATH ".\Videos"
But I think it is better to move images and videos straight to one folder and then just select them by some commands, if there are some. Thanks in advance

Do you really mean select, or are you aiming to filter what is displayed at the top and bottom?

Do you want to trigger this via a button click or something else?

Do you want it to also go to the folder when you push the button, or to act on the current folder(s) on each side?

If you only have a single extension for images files and a single extension for videos files, then set FAYT Filter Bar Activation Default mode to "Filter bar." Then, you can type the three letter extension in a lister and see only those files. Esc to see all files again.

If you have multiple extensions for each, then create under File Types, a File Type group for images and one for videos. Then create a filter for each group. Then create a Three Buttons button where the left mouse button is a toggle for the images filter and the right mouse button is a toggle for the videos filter. Left click on the button to toggle seeing only images or all files in the lister. Right click on the button to toggle seeing only videos or all files in the lister.

Sorry, I actually mean filtering them:). I'm thinking about triggering this via button and to act on the current folder on each side(upper and lower display), since I will need to open a folder myself anyway

Here's a button which will do that.

Filtering is based on the Images and Movies file type groups, which you can edit via Settings > File Types.

(If Opus isn't in English, or the groups have been renamed, edit the 2nd last line of the script.)

Script by itself, for easier reading:

function OnClick(clickData)
{
	var cmd = clickData.func.command;
	cmd.deselect = false; // Prevent automatic deselection
	cmd.ClearFiles();
	DoFilter(cmd, clickData.func.sourcetab.lister.activetab);
	if (clickData.func.sourcetab.lister.dual)
		DoFilter(cmd, clickData.func.sourcetab.lister.desttab);
}

function DoFilter(cmd, tab)
{
	cmd.SetSourceTab(tab);
	cmd.RunCommand(tab.right ? "Set QUICKFILTER=grp:Movies" : "Set QUICKFILTER=grp:Images");
}

XML format button for easier using:

<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" textcol="none">
	<label>Test JScript</label>
	<icon1>#script</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; // Prevent automatic deselection</instruction>
		<instruction>	cmd.ClearFiles();</instruction>
		<instruction>	DoFilter(cmd, clickData.func.sourcetab.lister.activetab);</instruction>
		<instruction>	if (clickData.func.sourcetab.lister.dual)</instruction>
		<instruction>		DoFilter(cmd, clickData.func.sourcetab.lister.desttab);</instruction>
		<instruction>}</instruction>
		<instruction />
		<instruction>function DoFilter(cmd, tab)</instruction>
		<instruction>{</instruction>
		<instruction>	cmd.SetSourceTab(tab);</instruction>
		<instruction>	cmd.RunCommand(tab.right ? &quot;Set QUICKFILTER=grp:Movies&quot; : &quot;Set QUICKFILTER=grp:Images&quot;);</instruction>
		<instruction>}</instruction>
	</function>
</button>

Thanks for your effort, Leo. Nothing happens in the lower display. It's because I usually open the folders in the upper display. It works, when I open the folder in both upper and lower display. So I think I need it to go to the folder in the lower display as well, when I push the button. I tried something with go commands. It doesn't help here

The button will set the left/upper display to filter on grp:Images and the right/bottom one to filter on grp:Movies.

If there is no right/bottom display, it'll just do the left/upper one, but will still work.

Thank you Leo, Yes, I'm aware of that. The problem is that the bottom display is just static (Opened "Pictures" by default). I open the folders in the upper display. So let's say I open folder1 in upper one, the folder1 should also be opened in bottom display as well, when I push the button. It'll work fine and filter the two file types, when the folder1 would be opened in both upper and bottom displays.

I thought you wanted the button to only do filtering, not change folders. But it can be made to do both if that's what you want.

If you link your account I can change the script to do that as well.

Try this:

<?xml version="1.0"?>
<button backcol="none" display="both" icon_size="large" label_pos="right" textcol="none" type="three_button">
	<label>Filter</label>
	<icon1>#filterfolder</icon1>
	<button backcol="none" display="both" icon_size="large" label_pos="right" textcol="none">
		<label>Documenrts</label>
		<icon1>#filterfolder</icon1>
		<function type="normal">
			<instruction>Set CLEARFILTERS</instruction>
			<instruction>CLI QUICKFILTER grp:documents</instruction>
		</function>
	</button>
	<button backcol="none" display="both" icon_size="large" label_pos="right" textcol="none">
		<label>Images</label>
		<icon1>#filterfolder</icon1>
		<function type="normal">
			<instruction>Set CLEARFILTERS</instruction>
			<instruction>CLI QUICKFILTER grp:images</instruction>
		</function>
	</button>
	<button backcol="none" display="both" icon_size="large" label_pos="right" textcol="none">
		<label>Left-Right</label>
		<icon1>#filterfolder</icon1>
		<function type="normal">
			<instruction>Set FOCUS=left</instruction>
			<instruction>Set CLEARFILTERS</instruction>
			<instruction>CLI QUICKFILTER grp:movies</instruction>
			<instruction>Go CURRENT OPENINDEST</instruction>
			<instruction>Set FOCUS=right</instruction>
			<instruction>Set CLEARFILTERS</instruction>
			<instruction>CLI QUICKFILTER grp:images</instruction>
			<instruction>Set FOCUS=left</instruction>
		</function>
	</button>
</button>

1 Like

jinsight, thanks I apreciate your efforts. The problem has been solved. Adding the go command "GO CURRENT OPENDUAL" in the Leo's js script solves it.

function OnClick(clickData)
{
	var cmd = clickData.func.command;
	cmd.deselect = false; // Prevent automatic deselection
	cmd.ClearFiles();
	DoFilter(cmd, clickData.func.sourcetab.lister.activetab);
	if (clickData.func.sourcetab.lister.dual)
		DoFilter(cmd, clickData.func.sourcetab.lister.desttab);
}

function DoFilter(cmd, tab)
{
    cmd.RunCommand("GO CURRENT OPENDUAL");
	cmd.SetSourceTab(tab);
	cmd.RunCommand(tab.right ? "Set QUICKFILTER=grp:Movies" : "Set QUICKFILTER=grp:Images");
}