FilterMenu Version 2
Latest Version (v2.2) : filtermenu.js.txt (39.1 KB)
Previous Versions : filtermenu.zip (17.1 KB)
This is a rewrite of the original 2018 FilterMenu GUI (Named Filter Menu):
Its main purpose is to provide a convenient way to access saved named filters combined with some useful companion Select options.
You can easily apply multiple filters in sequence, including ad-hoc simple or advanced filters, and you can choose to replace or add to existing selections.
The 2022 version responds to single left and right click on a named filter. It also includes "collection" options such as add, replace, duplicate, etc., as well as selection and hide/show options triggered via dialog buttons.
(1) The GUI tracks the current tab and the current path is shown near the top of the dialog.
(2) User defined filters are listed and can be left clicked to add to or replace current selections, or right clicked to remove matched items from current selections.
(3) Named filters and button actions operate on files, folders or both according the current Apply to..? setting. If qualifier keys are enabled, Ctrl, Alt, or Shift can be used to temporarily toggle the files/folders setting. Eligible buttons are flagged with blue borders.
(4) Buttons that act as toggles are flagged with yellow borders. When used with a qualifier key, ±Hide Files and ±Hide Folders toggles will prompt for a simple pattern to match; with no qualifer all files or folders are hidden or revealed.
(5) The target collection can be changed by overtyping the current name or by picking an existing collection from the drop down. ±Coll and ±Colls buttons are toggles that jump to the target collection (or coll://) and jump back. By default the same tab is reused. If qualifiers are active and a qualifier key is used then these buttons will jump to an existing tab or create a new tab if necessary.
(6) Preferences can be accessed quickly by clicking the Preferences button. If changes are made then the dialog needs to be restarted for the changes to be recognised.
(7) The Quit button can be used to exit the dialog and if the ESC option is active then the Esc key can also be used.
(8) When the showcommands option is enabled the information message will be replaced by the command that was executed by the most recent action.
How to install and use
Copy filtermenu.js.txt to /scripts (alias which points to the Script Addins folders) then..
Create a button on a toolbar that executes filtermenu
or type >filtermenu to execute as an "immediate" command.
Append options as required, e.g. filtermenu clearoutput collname="My Stuff"
Command line options are mostly the same as Preferences. fastclickms is a safety feature used to prevent multiple clicks of the same button being executed unless the second click occurs after the specified number of milliseconds has elapsed. The default value should not normally need to be adjusted. timerms is used internally to support single, rather than double, mouse click on a named filter. Again, the default value should not normally need to be adjusted.
Credits
Special thanks to @skinz who helped test and debug V2 and improve the GUI with constructive comments and suggestions, and to the ever helpful (and seldom sleeping) @leo whose Support for Prefs PAGE=FILTERS:MyFilter - #4 by Leo suggestion has been implemented when the Edit Filters button is clicked unqualified.
Problems?
If you encounter any repeatable issues please run the command with the debug option - filtermenu debug - and share (or PM) the relevant debug trace.
Note that the clearoutput option switches debug mode on and pressing a qualifier key when starting filtermenu also switches debug mode on.