Hide toolbar/menu button if a specific path does not exist

Is it possible to hide a toolbar/menu button if a specific path does not exist?

I can see there is @hideif and @ifexists, but there doesn't seem to be a @hideifexists.

I thought perhaps I could set a variable and then use that, but I'm not quite sure how to go about it, e.g.

@ifexists:

@hideif:$variable
...rest of command

Is this possible in some way?

Not currently. You could only show/hide it based on the current path, if that helps.

Unfortunately not, I'm wanting to hide the button if the external tool (Adobe DNG Converter in this instance) is not installed.

Is there a "vote for features" area anywhere where I could suggest that a @hideifexists modifier be added?

You could have a script that runs when Opus starts, tests if it's installed, and sets a variable which the button checks. That would also avoid hitting the filesystem every time the toolbar is refreshed, which can happen frequently.

This forum post is all you need to do for that.

Rather old post, nevertheless, I'm currently trying to hide/show a button if a path does not exists on my Windows installation.

Perhaps this feature already exists, running the latest (beta) of DO?

Edit: According to this thread,
I've now set up a global var "winmerge_installed" that is set to true or false in an OnInit script:

function OnInit(initData) {
...
    initData.config_desc = DOpus.Create.Map();
    var configName = "";
    configName = "winmerge_installed";
    initData.Config[configName] = DOpus.FSUtil.Exists("/programfilesx86\\WinMerge");

The button, that I want to show or hide has this code:

@hideif:!$glob:winmerge_installed

However, this does not work as expected. May I assume that the code above does just check if the var itself is available and not check it's value, likewise true or false?

It checks if the variable exists. Doesn’t check its value.

So, there is no chance to get its value without using scripting?
Maybe an enhancement for later releases?

The variable looks like it's just an on/off thing ("is WinMerge installed or not?") so why do you need a value here? Just delete the variable if it isn't installed, and create it if it is installed. You don't need a third value here, do you?

Ok, so I've done it this way: create global var only if the appropriate file or path is available.

Thanks for your suggestion!

Out of interest: Shouldn't @hideif:!$glob:winmerge_installed work either? Pls. note the !
IMO this should hide the button if the var "winmerge_installed" is not available? I've read this in an old release note document of DO.

That should work, yes.

Looking at your script, you're setting something in your script's configuration, not a global var.

Now, that you mentioned it, yes of course, you are correct!

I do use a script to set up global vars, found here on the forums, however this script has got a GUI to set those vars and I must set them by code, while checking for installed programs.

So what's the best option to set up a global var?

Edit: DOpus.vars should do the job...

At the end, this is a working solution, however, it requires additional coding to set up a global var.

It would be more convenient if hideif or any similar commands would support user defined logical expressions based on e.g. existing paths or files, as required above.