ShowIf evaluator statement side effects

I thought I was seeing things and it turned out that I was. The attached video demonstrates some odd side effects associated with a simple button with a single evaluator statement.

@showif:=((FileCount(true,"*.ocb") == 1) && (FileCount(true,"*.*") == 1))

showif test.dcf (435 Bytes)

For testing purposes I created a new toolbar with just this one button on it. The button should only show if a single .ocb file is selected in the current tab. The starting point is as shown in the static image. The button is correctly shown and because I am hovering my mouse over the button, its description is also displayed. The video demonstrates what happens when I alternate between selecting a single .ocb and selecting something else. Some of the time it works as expected but sometimes it triggers a copy of the .ocb onto itself and on other occasions it also triggers the download of another unrelated offline file. I subsequently tested with the same set of files in a local (non OneDrive) folder and the same download trigger behaviour happens. Opus v13.4.8 on Windows 10.

It's not a side effect of the command. It's a result of the toolbar resizing while your mouse button is down, which is acting like a drag & drop on the file the mouse was over if the mouse moves slightly after the resize and before the button is released.

Do it in a real situation where the toolbar has some items that aren't hidden and the problem will go away.

Well diagnosed Leo. If my hand had been steadier on the mouse it would never have happened. :blush: I do sometimes test a new button on its own and with the option of conditional button visibility in v13 this is something for me to remember.