Beyond Compare buttons

Share completed buttons and toolbars.

Beyond Compare buttons

Postby vdragan » 18 Aug 2009, 04:05

See Also: Diff/Merge Toolbar
See Also: WinDiff buttons

To those who uses Beyond Compare version 3. Here are buttons:

  • 1. for comparing two files selected in different file displays:

    Code: Select all
    C:\Program Files\Beyond Compare 3\BCompare.exe" {filepath$} {filepathdest$}
    @nodeselect


  • 2. for comparing two files within same lister:

    Code: Select all
    "C:\Program Files\Beyond Compare 3\BCompare.exe" {allfilepath$}
    @nodeselect


  • 3. for comparing two folders in two different file displays:

    Code: Select all
    "C:\Program Files\Beyond Compare 3\BCompare.exe" {sourcepath$|noterm} {destpath$|noterm}
    @nodeselect
I made this with great help from WinMerge topic

Regards,
Simon
vdragan
Registered Opus Pro User
 
Posts: 15
Joined: 11 Mar 2008, 04:05

Postby leo » 18 Aug 2009, 06:46

(Updated December 2011)

I use a slightly different command so I thought I'd share it here:

  • Replacement for 1 & 3 combined: Compare two files, or two folders, between left and right file displays:

    Code: Select all
    "C:\Program Files (x86)\Beyond Compare 3\BComp.exe" {leftpath}{file} {rightpath}{file}
    @nodeselect


    (32-bit users: Change Program Files (x86) to Program Files in the command.)

    If no files are selected then clicking the button will tell Beyond Compare to compare the left and right folders.

    If you select one or more files in either side of a dual-display window, then click the button, they will be compared against the files with the same names in the other side.

    With multiple files selected, this works best if you configure Beyond Compare to use multiple tabs instead of multiple windows.

    The button also ensures that Beyond Compare's left and right sides match what's displayed in Opus. (e.g. If the right-hand side happens to be active in Opus, it'll still be on the right in Beyond Compare, not swapped to the left.)

That works great for comparing folders, and for comparing files when they have the same names in both folders, and when you are using a dual-display window.

  • Alternative that works with different filenames and separate windows:

    It's also possible to make a similar button that works across two single-display windows, and also works for comparing files which have different names in each side.

    In this case, you have to select the file you want to compare in each side or window, so the button knows what you want.

    The button is also more complex to create, since it requires a User Command.

    Details of it are in a separate thread, File equivalent of {rightpath}/{leftpath}. (You want the first reply, from 2008. My reply from 2011 discusses the method I just gave above.)
User avatar
leo
GPSoftware
 
Posts: 29284
Joined: 07 Nov 2004, 01:30
Location: London, UK
OS: Windows 7 64-bit
Opus: Directory Opus 11

Postby yaramorgan » 18 Dec 2009, 08:57

These are really handy buttons, but I'm wondering if it's possible to simulate Beyond Compare's Explorer context menu:

Select Left Side
Select Right Side
Compare to...

I'm trying to get this done without incorporating BC's shell into DOpus. I've looked through BC's command line switches but there doesn't seem to be one that forces the selected file to be shown in the right or left pane. There also doesn't seem to be a way to load a single file into BC, navigate to another directory to select a second file, and then execute a "compare to..." command (referring to the previously loaded file in BC).

Does anyone know of a way to get this done without incorporating BC's shell into DOpus? I figured something simple like the following could work, but it doesn't (most likely because I haven't fully understood BC's command line switches)

Code: Select all
C:\Program Files\Beyond Compare 3\BCompare.exe" /left {filepath$}
@nodeselect
yaramorgan
 
Posts: 97
Joined: 10 Jul 2008, 22:08

Postby jon » 18 Dec 2009, 11:18

FWIW, I have the following command on my All Files context menu:
Attachments
Edit BCCompare_With_Other_Side action for type All files.png
Edit BCCompare_With_Other_Side action for type All files.png (90.17 KB) Viewed 11273 times
User avatar
jon
GPSoftware
 
Posts: 5806
Joined: 04 Nov 2004, 02:40
Location: Melbourne
OS: Windows 8 64-bit
Opus: Latest Beta

Postby BeeTeeEss » 18 Dec 2009, 15:28

Just curious, Jon...

Quite a few of your users, and now you yourself are using BC.

So far, I have not needed anything more than is offered by the DOpus sync tool.

Woulf you mind giving a brief explanation of what it is attracted you about BC?

Anyone else, feel free to comment too.
Regards...

Bernard
You will care less about what people think of you when you realise how seldom they do. ~ Oscar Wilde
User avatar
BeeTeeEss
Registered Opus Pro User
 
Posts: 497
Joined: 14 Nov 2004, 15:44
Location: Brisbane, Australia
OS: Windows 8 64-bit
Opus: Latest Beta

Postby leo » 18 Dec 2009, 15:34

BC is a diffing tool as well as a sync tool. Opus doesn't do diffing at all.
User avatar
leo
GPSoftware
 
Posts: 29284
Joined: 07 Nov 2004, 01:30
Location: London, UK
OS: Windows 7 64-bit
Opus: Directory Opus 11

Postby BeeTeeEss » 19 Dec 2009, 17:58

Ahh...

Thanks Leo.
Regards...

Bernard
You will care less about what people think of you when you realise how seldom they do. ~ Oscar Wilde
User avatar
BeeTeeEss
Registered Opus Pro User
 
Posts: 497
Joined: 14 Nov 2004, 15:44
Location: Brisbane, Australia
OS: Windows 8 64-bit
Opus: Latest Beta

Postby steje » 24 Dec 2009, 09:22

FWIW: I have a variety of buttons I use with my chosen diff tool... Araxis Merge:

For folder comparisons when I have a dual display lister opened to two different paths I want to compare:
Code: Select all
<?xml version="1.0"?>
<button backcol="none" display="both" icon_size="large" label_pos="right" textcol="none">
   <label>Merge Folders</label>
   <tip>Send current Folders to Araxis Merge</tip>
   <icon1>#araxis3</icon1>
   <function type="normal">
      <instruction>@runmode max</instruction>
      <instruction>/jtools\araxis\merge.exe {l} {r}</instruction>
   </function>
</button>

For file comparisons when I have a dual display lister opened to two different paths, each with files selected I want to compare:
Code: Select all
<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" separate="yes" textcol="none">
   <label>Merge Files</label>
   <tip>Send seleted Files to Araxis Merge</tip>
   <icon1>#araxis3</icon1>
   <function type="normal">
      <instruction>Set SOURCE=Left </instruction>
      <instruction>dopusrt /cmd mergefile</instruction>
   </function>
</button>

One of the things I really liked about an update made awhile back to Opus was the addition of {leftpath} and {rightpath} arg codes used in the first button in their short form of {l} and {r}...

The weird thing I'm doing in the second button is done that way to make sure that regardless of which side lister is currently active, the file in the left side file display (top file display when in horizontal mode) is always oriented the same way in my diff tool... which is then called from a user command (mergefile) that runs:

@runmode max
@nodeselect
/jtools\araxis\merge {f} {fd}


...the {l} and {r} handles that for "paths" in folder compares, so it would be kind of nice to have something like {filepathleft$} / {fl} and {filepathright$} / {fr} to do similar for file selections... :-).

I like Jon's example of using {filepath$} and {destpath$}{file$} so that you don't have to actually SELECT the second file in the 'other' file display... but it only works when you're comparing files with the same name between source and destination - and very often I'm comparing differently named files in MY work...
The only sovereign you can allow to rule you is reason!
Settings->Backup & Restore is your best friend! | Get Priority Support!
Opus 10 x64 | Windows 7 Enterprise and Home Premium sp1 (x64)
User avatar
steje
Registered Opus Pro User
 
Posts: 4050
Joined: 15 Nov 2004, 20:51
Location: NY, USA
OS: Windows 7 64-bit
Opus: Latest Beta

Postby yaramorgan » 27 Dec 2009, 07:51

@ Jon and Steje - thanks for sharing your buttons! I asked my previously posted question over at the BC forum (if it's possible to simulate the BC Explorer context menu via command line). Unfortunately, it's not. Only their shell extension is able to perform those functions, and must be installed. For now, I'm just going to keep the BC shell integration with DOpus, and add a few of the buttons posted here :)
yaramorgan
 
Posts: 97
Joined: 10 Jul 2008, 22:08

Re: Beyond Compare buttons

Postby chodor » 07 Feb 2012, 07:07

I was wondering if it is possible to use BC to for diff with remote-FTP file without entering FTP credentials in BC - when I try to use Leo's button BC3 tries to open FTP link and asks for credentials...

Maybe it wouldn't be a problem but when launching BC with Leo's button BC3 asks every time for credentials (login and password) even though FTP profile is already saved for this domain (probably because that BC tries anonymous login first)
chodor
Registered Opus Pro User
 
Posts: 25
Joined: 22 Jul 2011, 14:51
OS: Windows 8 64-bit
Opus: Latest Beta

Re:

Postby wowbagger » 04 Oct 2012, 19:03

leo wrote:[list][*]Replacement for 1 & 3 combined: Compare two files, or two folders, between left and right file displays:

Code: Select all
"C:\Program Files (x86)\Beyond Compare 3\BComp.exe" {leftpath}{file} {rightpath}{file}
@nodeselect



If a file is selected this code compares a file with the same name in left and right listers. Is it possible to have a button that compares the folder path if nothing is selected, or the first item in each lister if a file is selected?

I thought this would do it, but it always falls back to folder compare.
Code: Select all
"C:\Program Files (x86)\Beyond Compare 3\BComp.exe" {sourcepath}{file} {destpath}{filedest}
@nodeselect
User avatar
wowbagger
Registered Opus Pro User
 
Posts: 444
Joined: 18 Jun 2006, 15:33
Location: Brisbane Australia
OS: Windows 7 64-bit
Opus: Latest Beta

Re: Beyond Compare buttons

Postby leo » 04 Oct 2012, 21:20

It already does that.
User avatar
leo
GPSoftware
 
Posts: 29284
Joined: 07 Nov 2004, 01:30
Location: London, UK
OS: Windows 7 64-bit
Opus: Directory Opus 11

Re: Beyond Compare buttons

Postby wowbagger » 05 Oct 2012, 00:22

You are correct my script does what I wanted. Didn't seem to but now I test it again I see it does.

*edit, I misunderstood your reply
User avatar
wowbagger
Registered Opus Pro User
 
Posts: 444
Joined: 18 Jun 2006, 15:33
Location: Brisbane Australia
OS: Windows 7 64-bit
Opus: Latest Beta

Re: Beyond Compare buttons

Postby manix » 28 Oct 2012, 11:26

Leo, Need small help. I have copied your commands
"C:\Program Files (x86)\Beyond Compare 3\BComp.exe" {leftpath}{file} {rightpath}{file}
@nodeselect

and tried to follow steps to create new buttons using customzie; but I could not get the "paste" options available. Your help is appreciated.
manix
 
Posts: 1
Joined: 28 Oct 2012, 11:22
OS: Windows 7 64-bit
Opus: Directory Opus 10

Re: Beyond Compare buttons

Postby leo » 06 Dec 2012, 05:22

I've expanded the How to add buttons from this forum to your toolbars post so that it explains what to do with raw commands that aren't full XML button definitions.
User avatar
leo
GPSoftware
 
Posts: 29284
Joined: 07 Nov 2004, 01:30
Location: London, UK
OS: Windows 7 64-bit
Opus: Directory Opus 11


Return to Buttons & Toolbars