XY + WinMerge

Discuss and share scripts and script files...
bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: XY + WinMerge

Post by bdeshi »

I use this simple catalog entry.
select two items in currPane OR one item in each pane!

Code: Select all

"BeyondCompare"
  //prio: 2xSelxPane > 1xSelxPanes
  $app = "<xypath>\..\BeyondCompare\BCompare.exe";
  $cmd = '/fv="Hex Compare"';
  $pa  = get(SelectedItemsPathNames,'|',a);
  $pi  = get(SelectedItemsPathNames,'|',i);
  if     (gettoken("$pa",count,'|') == 2)  {$files = '"'.replace($pa,'|','" "').'"';}
  elseif (gettoken("$pa",count,'|') == 1)&&
         (gettoken("$pi",count,'|') == 1)  {$files = """$pa"" ""$pi""";}
  else   {$files = "";$cmd = "";status "BCompare::pick one item in each pane Or two in current pane to diff";wait 1;}
  run    """$app"" $files $cmd";
Any differ script needs pane-comparison! Panes are there asking to be compared! :D

ed: btw, what's the use of /e and /r? BCompare doesn't have these options.

[ed:beautify]

ed: I now added a normal BCompare launcher option to the script! 8) (plus fixed a overly enthusiastic beautification. : oops : )
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Regmos
Posts: 268
Joined: 22 Dec 2012 07:27
Location: Copenhagen

Re: XY + WinMerge

Post by Regmos »

Nice one Enternal :appl:

I've used a normal openwith "......BeyondCompare" toolbar button for a long time, and it suddenly became so much better :tup: :beer:
Kind regards
Regmos

Enternal
Posts: 1174
Joined: 10 Jan 2012 18:26

Re: XY + WinMerge

Post by Enternal »

Thanks guys! I'm glad that it's useful! I just thought of it while working on the TimeSync to make it easy to sync a file date to another file date. I then realized that I can merge part of that into this code since the original was kind of clunky and if 2 files happened to be in the same folder, I would have to open it up twice in both panes.

@ SammarySarkar
Oh, according to the manual:

Code: Select all

/r compares all files in all subfolders (recursive compare). Unique folders (occurring only on one side) are listed in the compare result as separate items. Note that including subfolders can increase compare time significantly. Without this parameter, WinMerge lists only files and subfolders at the top level of the two target folders. It does not compare the subfolders.
/e enables you to close WinMerge with a single Esc key press. This is useful when you use WinMerge as an external compare application: you can close WinMerge quickly, like a dialog. Without this parameter, you might have to press Esc multiple times to close all its windows.
It was also part of the old code so I just left it. And hahaha so you had something similar as well! The way mine worked though is it works with both panes so no priority of one pane over another. Although I still think I have a clunky way of "selecting the other file that's not selected" by using replace SC.

Post Reply