D8viewer - configuring a generic button

I'm struggling with a generic button configuration for d8viewer.exe that will work properly from my hard drive or from a USB key. My LMB and RMB are set up as follows..

cd /home
d8viewer.exe

cd /home
d8viewer.exe {f}

LMB does nothing when clicked whereas RMB works as expected when a file is selected and RMB is clicked. I can't get the d8viewer icon to show either. When I specify /home\d8viewer.exe as the source I just get the default smiley face.

Ideas?

Regards, AB

Using the Show command is easier. It's on the default toolbar right after the Delete and Undo buttons. If you've removed it then you can find it under Settings -> Customize / Commands / File Commands.

Your LMB command is not passing any filenames of d8viewer.exe so the program (d8viewer.exe) isn't going to know what you want it to view.

It doesn't look like folder aliases work in icon paths.

Thanks for reminding me about the Show command. It's clearly the way to go.

I actually have a sequence of LMB/RMB buttons for various viewers, all of which open with a blank screen if no file is selected. I had assumed that d8viewer would do the same. I should have tested that assumption before posting... :blush:

Regards, AB

On related matters... is there a way to retain the selection after a Show operation? Currently, whatever files are selected for Showing are deselected after exiting from the viewer.

Regards, AB

You don't need separate LMB/RMB buttons for that for most programs. You can do it with just a single button which uses the {filepath} code.

{filepath} means want a filepath. If no files are selected then it will be skipped and, in your example, the viewer will be run without any arguments.

{filepath$} means need a filepath. If no files are selected then the command won't be run at all. You would normally use this, except in cases like yours where you want to launch the program whether or not anything is selected.

If you want to open the viewer without anything selected then you could make a button which tells it to view an arbitrary image on your computer.

Yup, add a line with @nodeselect to the button.