GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Show first selected file

I thought I had this figured out, but apparently not. After sorting through a folder of several hundred files and selecting a relative few, I needed a keystroke to scroll the listing back to the first selected file. It thought 'Select SETFOCUS NOPATTERN' would do it, but it doesn't. Neither does 'Select MAKEVISIBLE NOPATTERN'. What am I missing?

This button will do that:

Jump to First Selected.dcf (601 Bytes)

See How to use Buttons and Scripts from this forum if you need instructions on how to use it.

Script code for reference:

function OnClick(clickData)
{
	var cmd = clickData.func.command;
	cmd.deselect = false;
	cmd.RunCommand("Select FROMSCRIPT MAKEVISIBLE=immediate");
}

It uses the FROMSCRIPT argument and the fact the cmd object is pre-populated with the current selection, to tell the command to select the files which are already selected (which obviously doesn't do much on its own), and make the first one visible (the part we want).

Thanks, Leo. Any ideas why what I tried doesn't work?

What you tried just isn't a combination of arguments that works at the moment.