Help passing left and right selected folders in simple button

Greetings, I am new to Dopus but have done quite a lot of coding over the years.

I am trying to create a few simple buttons and managing Ok but I have hit a stumbling block with a very simple button.

I have an application called Beyond Compare that is used for detailed analysis of file and folder differences (amongst other things). The parameters I pass to it are very simple.

I have made a button that works well but I must be actually inside the folders I want to compare:

"C:\Program Files (x86)\Beyond Compare 4\BCompare.exe" "{leftpath}" "{rightpath}"

What I actually want to do is pass the parameter for the SELECTED folder (or file) on the left and on the right. So it would be like this:

"C:\Program Files (x86)\Beyond Compare 4\BCompare.exe" "Dopus SELECTED file or folder on LEFT side of lister" "Dopus SELECTED file or folder on RIGHT side of lister"

I have been through all the documentation and I can find no obvious way to do this, yet I am sure it must be possible to pass the left and right SELECTED files or folders to an external application. Or even just the left and right selected folder.

If someone can please point me towards how it can be achieved I would be very grateful.

Thank you kindly.


If you put Set SOURCE="left" at the beginning of your button code then {allfilepath} becomes the left selected files and {allfiledest} becomes the right selected files.

So full button code would be something like:

Set SOURCE="left"
"C:\Program Files (x86)\Beyond Compare 4\BCompare.exe" "{allfilepath}" "{allfiledest}"

For Beyond Compare, you probably want to use one of the scripts in this thread, which makes the button more context sensitive:

There are also some simple, non-script Beyond Compare buttons here:

And here is a general discussion about passing the selected left and right filenames to programs (without using scripting):

OK I have it, I discovered that destination is the "other selected file or folder". So:

"C:\Program Files (x86)\Beyond Compare 4\BCompare.exe" "{filepath}" "{filepathdest}"

Works. the only downer really is that it seems destination is always the second file or folder selected.

So if I select the left folder then the right folder, Beyond compare opens with the right folder on its left etc.

Oh thank you just saw your reply. Very kind of you.

Thank you also. :slight_smile:

The smart front end script does more than I need and is perfect thanks guys. I should have searched the forum more carefully. :slight_smile: Thanks again everyone.