@disablenosel:folders,(type=*.*) Does Not Gray Out Non-Folders for an All Files and Folders Context

My goal is to create a button that for a currently selected folder in the source, opens it in the destination. The button should be grayed out if a folder is not selected.

The following code works but has one problem:

 @disablenosel:dirs,(type=*.*)
 //dirs or dirs,(type=*) or dirs, (type=*.*) have the same effect
 Go FROMSEL OPENINDEST NEWTAB 
  1. As a button, this worked and the button was grayed out for any selected files. As an All Files and Folders context menu item, it worked but the label text was grayed out only for .lnk files. This seems wrong. The same code ought to have the same effect in both places.

By the way, @hidenosel has the same problem. As a button, this worked and the button disappeared for any selected files. As an All Files and Folders context menu item, it worked but the button never disappeared and was grayed out only for .lnk files.

What am I missing? TIA

It should be just @disablenosel:dirs

But note that as long as at least one directory is selected, the button will be enabled, even if files are also selected.

Why not put it on the All Folders file type and avoid the need to disable/hide it entirely?

Why not put it on the All Folders file type and avoid the need to disable/hide it entirely?

Because then I can't control where the item goes. If it's in Only Folders, it goes above all the All Files and Folders items at the very top of the list. I want to keep all items that open something together.

Again the issue is consistency.. If code works in a button, it should work in a context menu item. Here it does not. As a button, the label is grayed out and in the context menu it is not grayed out.

The code you're using doesn't make sense for what you're trying to do. It's saying "enable this item for directories or files matching *.*"

Almost all files will match *.* (unless they don't have a . in their names), so it's going to show the button for almost everything.

@disablenosel:dirs,(type=*.*)
@disablenosel:dirs,(type=*)
@disablenosel:dirs

All three have the same problem as already said: the issue is consistency. If code works in a button, it should work in a context menu item. Here it does not. As a button, the label is grayed out and in the context menu it is not grayed out.

If anyone tries this and gets different results than what I have posted, please let me know.

image

@disablenosel:dirs

disables unless a folder is selected

1 Like

In a quick test I get the same result as @galaxyhub.

Folder selected, command is enabled: (it's at the very bottom of the menu)

File selected, command is disabled:

Thank you very much for the pictures. It inspired me to take a hard look at the code. My bad, I old code from prior tests on a prior line overriding @disablenosel:dirs. I just didn't "see" it over and over again because I "knew" what was there. Sorry for taking up so much of everyone's time.

1 Like