ToolbarPalette : A Command Palette option for Opus

ToolbarPalette is a script add-in command for Directory Opus, allowing users to execute their commands, scripts, and other toolbar content quickly and efficiently through an intuitive search interface. Inspired by command palettes from other applications, this tool integrates seamlessly into your workflow, giving you the ability to search 'n run across all your toolbars.

Motivated by @grosner's request, a standout feature is the ability to easily locate and use buttons from any toolbar—even those not currently visible—making it especially useful for users managing multiple toolbars.

Key Features:

  • Provides a search interface to execute any button from any toolbar, as if launched directly from it.
  • Allows searching by label, description, instructions, hotkey or toolbar names.
  • Prioritizes speed when handling results.
  • Advanced search options for greater control over results.
  • Supports Opus wildcard syntax, regex, case matching, diacritics, and whole-word searches.
  • Extensive customization for indexing toolbars, including those not in active use.
  • Indexation capability for improve performance.
  • Support parameters such as selected files and other Opus-specific arguments, just like a button!
  • Real-time detection of toolbar changes!
  • Fully customizable right click menu, with support for variables included.

:warning: IMPORTANT: READ BEFORE PROCEED

This script is provided "as is" and without warranty of any kind or whatsoever.
It has been made during my spare time and has not been extensively tested, so it is presented as a testing version.
The user assumes full responsibility for its use and understands that the author is not responsible for possible failures or loss of data.
Kind remind that this is a work in progress, so expect bugs.
Any feedback on possible improvements or bugs is welcome.

How to Install

:warning: IMPORTANT: Needs at least DOpus v13.12
Download the file below. Then go to Settings / Scripts (or run Prefs SCRIPTINSTALL) and select the downloaded file.

v2.0.0 : ToolbarPalette.opusscriptinstall

Options

In the Script Management window, select ToolbarPalette and click in the Edit button.

  • log level : Logging level to be displayed.
    • OFF to show only errors.
    • DEBUG to show all messages.
    • STANDARD to show only the most relevant information.
    • WARNING to show messages that needs your attention.
  • nested separator : Separator to use in anidated menus.
  • excluded words : If a command has one of this words, it will be excluded from list.
  • include lister hotkeys : Set to True to include entries from lister hotkeys.
  • include system hotkeys : Set to True to include entries from system hotkeys.
  • include floating toolbars : Set to True to include buttons from floating toolbars.
  • include all toolbars : Set to True to include all the toolbars, even the unloaded ones.
  • excluded toolbars : List of toolbar names that will be ignored by the command.
  • no exit after run : Set to True to keep the command open after running the selected button.
  • load/save UI position : Set to True to save and load the dialog's last used position.
  • allow multiple instances per lister : Set to True to allow multiple commands running
    simultaneously per Lister.
  • Label column max width : Max width for Label column. Set to 0 to always autosize to content.
  • FunctionType column max width : Max width for Function Type column. Set to 0 to always autosize to content.
  • Hotkey column max width : Max width for Hotkey column. Set to 0 to always autosize to content.
  • Description column max width : Max width for Descrption column. Set to 0 to always autosize to content.
  • Instructions column max width : Max width for Instructions column. Set to 0 to always autosize to content.
  • Esc key close dialog : Set to True to use Escape key to close the dialog.

Usage

ToolbarPalette supports the following arguments:

Command Arguments

ARGUMENT TYPE DESCRIPTION
FORCERELOAD /S Force database index creation.
REGEX /S Open the dialog with 'Regular Expressions' checked
CASE /S Open the dialog with 'Match case' checked
WHOLEWORDS /S Open the dialog with 'Whole words' checked
WILDCARDS /S Open the dialog with 'Opus Wildcards' checked
DIACRITICS /S Open the dialog with 'Allow diacritics' checked.
FORCEEXEC /S By default, when executing certain buttons (e.g. those with instructions that take the selection into account), a confirmation is displayed.
Using this argument suppresses that confirmation.
ADVSEARCH /S Enables Advanced Search (see below in Notes > Advanced Search).
SEARCHFILTER /R Starts the dialog with the filter set by this argument.
EDITMENU /S Open the Edit Menu dialog to customize the right click menu.
NOFILTER /S Force inclusion of detected dynamic buttons in the list.

EditMenu

Version 2.0.0 introduces a right-click menu for each item that can be customized. To do this, you can use ToolbarPalette EDITMENU or the pencil icon from the ToolbarPalette window. These entries are designed to execute/automate tasks related to toolbars and their associated entries. For example, copying a toolbar, displaying a non-visible toolbar in the List, etc.

The supported commands are the same as those used within Directory Opus (e.g., when creating a button), with the feature that the following variables are predefined:

  • $label$: Label of the button/menu shown in the list.
  • $desc$: Description of the button/menu shown in the list.
  • $hotkey$: Hotkey of the button/menu shown in the list.
  • $toolbar$: Name of the toolbar of the button/menu shown in the list.
  • $instr$: Instructions of the button/menu shown in the list.
  • $toolbar_file$: Full path of the toolbar on disk where this button/menu is located.
  • $toolbar_group$: Indicates the position of the toolbar in the List where this button/menu is located. It can be top, bottom, left, right, center, fdright, fdbottom, tree, none, hotkeys, or menu.
  • $toolbar_pos$: Line number within the toolbar's group that it resides on in the List where this button/menu is located. -1 if not part of a toolbar.
  • $toolbar_line$: Pixel position from the left/top of the toolbar's line in the List where this button/menu is located. -1 if not part of a toolbar.

Hotkeys

Available hotkeys are :

F5 : Refresh the list
F3 : Focus on the filter control
Alt+W : Toggle 'Use Wildcards' button
Alt+G : Toggle 'Use Regex' button
Alt+C : Toggle 'Match case' button
Alt+D : Toggle 'Allow diacritics' button
Alt+H : Toggle 'Use whole words' button
Up/Down : Navigation buttons

If the list has focus:
Enter : Run the selected item
Ctrl/C : Copy instructions from the selected item to the clipboard

Also Enter will apply the filter when Advanced Search is enabled.

Notes / Technical Stuff

  • General

    • Certain buttons may have "usage requirements" based on the selection type or other scenarios.** By default, the command detects these instructions and asks for confirmation to continue executing them (since their usage requirements may not be met). So, special attention should be given to these warnings!
    • Some buttons with instructions that generate dynamic content (e.g. GO FOLDERCONTENT,Go DRIVEBUTTONS, FILETYPE***, etc) are automatically ignored.
    • You can use excluded words if you detect any others that may cause issues when used out of context.
    • If you are using this command for something other than executing other commands, you may want to include the NOFILTER argument, which forces the listing of this type of command.
  • Context Menus

    • The only context menu currently supported is All Files and Folders. In the future, it may expand to include all context menus, which would be added or removed from the list depending on changes in the item selection within the Lister.
    • Entries in context menus that use FILETYPE CONTEXTMENU or similar are ignored because, unfortunately, they cannot be executed outside the menu's context, and no known workaround exists.
  • Hotkeys

    • Certain keys may depend on the language and keyboard layout. Since there doesn't seem to be a way to obtain that data via scripting, the command "assumes" that the language matches the one in which DOpus is running. As a result, errors may occur, or the key may appear as ??? in some cases.
  • Advanced Search

    • Allows performing searches based on more advanced criteria, combining search fields using basic logic.
    • Its syntax is in the form: $l|d|v|t|h(==|!=)"value", where:
      $l: Label
      $d: Description
      $v: Instructions
      $t: Toolbar
      $h: Hotkey
    • && or AND and || or OR are supported
    • e.g. $l=="fav" && $d!="edit" It will list all the entries with "fav" in their labels and whose description does not contain "edit".
  • UI

    • There is a small "button" that acts as a pseudo-tooltip to help identify the search flags, located right below them.
    • You can choose which fields to use in the search by clicking the filter icon and selecting them. By default, it fallsback to "label".

Greetings

To @grosner for the idea.
Anyone who participate in the betas.
@abr for the German translation.

Changelog

v2.0.0 (Jan 13, 2025) : ToolbarPalette.opusscriptinstall (22.7 KB)

  • Added support for listing hotkeys.
  • Added support for listing entries in context menus (limited to "All Files and Folders").
  • Added support for a fully customizable right-click menu with predefined variables:
    • Current variables include: $label$, $desc$, $hotkey$, $instr$, $toolbar$, $toolbar_file$, $toolbar_line$, $toolbar_pos$, and $toolbar_group$.
    • The menu comes with two predefined entries to help you understand how to use it.
  • New arguments: EDITMENU, NOFILTER.
  • Added options to define maximum width for columns in the list.
  • Other minor fixes.
Full changelog

v1.0.2 (Jan 04, 2025) :

  • Added allow comments in commands in the Script Config, enabling users to choose whether commented lines in instructions are displayed or ignored.

v1.0.1 (Jan 01, 2025) :

  • Added exclusion for additional Go commands in instructions.
  • Added exclusion for commented instructions.

v1.0.0 (Dec 22, 2024) : Initial release

14 Likes

GASP! :exploding_head:

this is fantastic! Thank You! Thank You! Thank You!

we chatted bout this a while back.

I'm running out of hotkeys... ...and my toolbars continue to grow all the time. So this this going to be great! I've started using AHK with #ifwinactive to send tricky hotkeys to dopus when keys are double tapped. But I digress.

Two thoughts\requests...

#1 Is there (or could there be) a way to open into customize mode on a selected item? alt + enter ot dopus own alt + click

#2 add a dedicated hotkey column that shows current hotkey if found? This kind of overlaps with the customize window, thou this does a better job finding every toolbar item where the KEYS tab only show items that have had keys already set.

again, thank you and bravo for this amazing addition to the the dopus arsenal!

~xavier

Thanks for the feedback.

  1. Nope. Sorry. There is no way to automate that.
  2. I had already discussed this during the testing period. The problem would be that certain keys / key combinations depend on the keyboard layout. And as far as I know there is no way to grab that info via scripting. (I mean the language/layout the keyboard is in). Opus saves the info of some hotkeys based on the layout and I wouldn't know how to "translate" that in 100% correct form.
  1. Aww that's too bad. at least this makes it easier to search all buttons created.

@errante
Have just seen you have released V1 was a beta tester
Had been trying to find all descriptions that are blank in the beta version with no luck.
But with the advanced search in V1 $d=="" finds them all 3637 out of 7733.
Got a lot of work to add descriptions

Before using beta had 9036 buttons got rid of a lot of duplicates and now have 7733 still a lot of duplicate buttons to sort.

Really useful

Thanks for the hard work you have put into it

onedot3

@errante

Does not find descriptions if they are in a menu is this correct.
Is it to do with description does not show when mouse over a menu.

Not really, no.
If the entry is listed then it should find it.
If is not listed it should depend on the instructions. Whether it’s not relevant for the command or filtered out by another option.
What's the full instruction for that menu?

@errante
Menu Button


If I search for Working Opus 13 it is found

Menu


If I search for Master it is not found

Whilst doing some more tests
If there is nothing in the Instructions as in image below


If I search for Working Opus it is not found

The same happens in a normal Button no Instructions Button search by Label or Description Button not found

No surprises there, because that entries doesn't have any instructions at all, so there’s no reason for the command to list it.
Kindly remember that the purpose of this command is to provide a searchable interface from which you can execute commands/instructions configured in your toolbar buttons/menus.
(I didn’t notice the support for comments in the instructions; they should also be filtered out. Thanks for pointing that out)

v1.0.1 (Jan 01, 2025) :

  • Added exclusion for additional Go commands in instructions.
  • Added exclusion for commented instructions.

Very nice one, thanks. :+1: :beers:

Would it be possible to include an info about which hotkey is bound to the commands?

Thanks.
The info is there, yes. But first I need to figure out how to translate it into something human readable while considering the keyboard layout.

1 Like

Yes, that sounds logical. I just mentioned it, because it would be a good aid to re-learn long forgotten, rarely used combinations. But your script is already of great help, as compared to digging into the prefs pages.

v1.0.2 (Jan 04, 2025) :

  • Added allow comments in commands in the Script Config, enabling users to choose whether commented lines in instructions are displayed or ignored.
1 Like

FWIW, I'm wrapping up my last days of vacation and worked on the hotkey listing. I could use some volunteers to help check for any errors in how the hotkeys are interpreted. If you're interested, feel free to send me a PM!

1 Like

@errante
1.0.2 allow comments in commands

In 1.0.0
//comment
// comment
Both show in instructions and can be searched for
But in 1.0.2
//comment does not show cannot be found in search
// comment does show and can be found in search

From the Advanced Command Editor
Lines beginning with // are ignored, allowing you to put comments in your commands. The // must be at the very start of the line, with no spaces or anything else before it, for the line to become a comment.
Nearly all my comments are //comment
I am trying to find all comments that are not needed.

I'm pretty sure that if that was working in 1.0 but not in 1.0.2 is because you did not set allow comments in commands to true.
And fwiw it is working here.

Unless of course that comment has not been excluded by another filter.
Maybe that could be improved, but it has very low priority for me since the command's main purpose is to run other commands.

@errante
You are correct when you said it works.
The first thing I did when installing 1.0.2 was set allow comments in commands to true but TBP still used false until you File / Exit Opus and restart Opus then it works correctly.
The same goes for changing from true to false you have to File / Exit Opus and restart for the exclusion to work.

Ok. So @onedot3 I've added more flexibility to the command regarding what it lists and what it doesn't. Now it distinguishes between what is displayed and what is executed.

I've also included many new options (like listing button's hotkeys).

Since it seems you're the only one using this command, I can send you a copy if you'd like.

@errante

Yes quite happy to do some more testing
Even though I am not using it for what you made it for yet.
I am finding it very useful for getting rid of duplicate and unused buttons, removing unwanted comments.