GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Command: ScrollSelectionIntoView


#1

ScrollSelectionIntoView - A small script command to automatically scroll the file display to the current selection.
I use it when toggling between details and thumbnails mode to keep the selected items visible. It won't do anything if nothing is selected.

You may add it to your view-toggle button as I did or put it in a new button to have this separately available. It is nice for buttons where you set a show- or quickfilter as well, I somehow can't do without it anymore. o)

My view toggle button using this command looks like this:

@ifset:VIEW=Details Set VIEW=Thumbnails ScrollSelectionIntoView @ifset:else Set VIEW=Details ScrollSelectionIntoView

Installation:
To install the command, download the *.js.txt file below and drag it to Preferences / Toolbars / Scripts.
After that create a separate button calling "ScrollSelectionIntoView" or edit existing view changing buttons and menues, to call it directly after any "Set VIEW.." command.

Download:

[ul][li]Latest: v1.2.1 - supports automatic updates/scriptwizard:
Command.GUI_ScrollSelectionIntoView.js.txt (4.47 KB)
[/li]
[li]v1.2 - using tab.stats to detect regular selection without extra checkbox toggle, commandline param PRIOCHECKBOXSELECTION added:
Command.GUI_ScrollSelectionIntoView.js.txt (3.35 KB)
[/li]
[li]v1.1 - supports selection in checkbox mode now as well, and parameter to priorize checkboxmode (defaults to false):
Command.GUI_ScrollSelectionIntoView.js.txt (3.54 KB)[/li][/ul]

cya! o)
tbone


Command: SelectEx (extended Select command)
After toggling flatview the selected item is offscreen
Can't show focussed item after clearing the quickfilter bar
Command: SelectRandom (randomly select files/folders)
#2

Nice work! Thank you very much!


#3

Updated to v1.1

  • supports checkbox mode now as well (but regular selection has priority by default)
  • new parameter/config switch to priorize checkboxmode (defaults to false)
  • new debug output config switch

The command will disable checkbox mode temporarily (if not priorized by switch), to check for selections in regular mode to scroll for.
If a regular selection is not present, it will try to scroll to first selected checkbox item. No selections get lost during this process of course.


#4

Thanks TBone. Very useful. I have added a ScrollSelectionIntoView button to my Images toolbar.

Regards, AB


#5

Updated to v1.2

  • use of tab.stats to detect checkboxed and regular selection, which avoids a lot of extra checkbox toggles
  • commandline param PRIOCHECKBOXSELECTION added

This version is smaller and more efficient than the previous one, it avoids unnecessary flickering if there are no checkbox items selected, so it's smoother in most cases.
In the meantime I added this command to buttons that change the sort order as well and I like it more than ever! o)
It's just so very convenient to be able to toggle between "named" or "creation date" sort order, while your currently selected item stays visible all the time.

@aussie
You're welcome, thanks for giving feedback! o)