Enable/disable menu or button based on filetype

Is it possible to enable/disable a menu (or button) based on the filetype of the selected file or based on a specific group of files (e.g. images)?
Just like the Image toolbar appears/disappears when entering a folder with images I want a menu to enable/disable.

'm not very happy with the Image toolbar so I want to place those buttons in a menu.
The button that works well with all files is the Show button. Also some sort buttons work fine. Other buttons do nothing when I have selected a file other than an image so at least no error messages. But it would be nice if I could disable the menu and/or buttons when they are not applicable. Is this possible in DO12?

Yes, using the @hidenosel and @disablenosel command modifiers, described here.

Great. Thanks for the quick reponse.

I don't get it working.
When I add @disablenosel:type=*.jpg to the Rotate Left button it stays always enabled. Only when no file is selected the button is disabled but that's a build in function because I see no option in the button function, which is:

Image ROTATE=270 HERE REPLACE @disablenosel:type=*.jpg @nodeselect

Also, do I have to enter all image filetypes or is there a category for all image files?

If I heve to enter all image files (or at least the main ones) can I use a separator or do I need to repeat the @disablenosel line for every filetype? I tried to test this but because the disabling is not working at all I didn't get far.

Put the @disablenosel line at the top, or at least before the Image command.

You can use grp:Images to make everything in the Images file type group:

@disablenosel:type=grp:Images @nodeselect Image ROTATE=270 HERE REPLACE

Ah, the order matters. Now it's working the way I want. And the grp type is also very handy. Thanks again. :thumbsup: