XY + WinMerge
XY + WinMerge
Not very elegant, but.... this one lets you select two of your open tabs, and opens WinMerge (a file synchronization program) with both directories loaded for comparison:
You need to adapt the location of WinMerge in your system.
"WinMerge:WinMerge"
#343;
set $first, <curpath>;
#343;
set $second, <curpath>;
set $cmd, """D:\Software\WinMergePortable\WinMergePortable.exe"" /e /r /f ""*.frm *.cls"" """;
addstr $cmd, $first, """ """, $second , """";
open $cmd;
You need to adapt the location of WinMerge in your system.
"WinMerge:WinMerge"
#343;
set $first, <curpath>;
#343;
set $second, <curpath>;
set $cmd, """D:\Software\WinMergePortable\WinMergePortable.exe"" /e /r /f ""*.frm *.cls"" """;
addstr $cmd, $first, """ """, $second , """";
open $cmd;
I don't have winmerge but the approach is what I think could offer a sensible and elegant solution to the DP user need for file comparisons.
Taking this concept further ...
Rather than a complete integration of DP within existing code of XY this approach offers many possibilities for external programs to solve a special DP need. This is why I once remarked that for those wanting DP all that was required was a definition of the 'user needs'. It could be that these needs can be solved by calling (script?) an external written program or module to satisfy a particular need. It will not satisfy the die hard DP user who wants it all but there are DP programs out there that do this so why complicate XY tab principles for a few special needs. I urge Don to explore this approach as a very feasible solution to satisfy most DP wishes (90%) and the remaining 10% will have to revert to a DP only program.
Taking this concept further ...
Rather than a complete integration of DP within existing code of XY this approach offers many possibilities for external programs to solve a special DP need. This is why I once remarked that for those wanting DP all that was required was a definition of the 'user needs'. It could be that these needs can be solved by calling (script?) an external written program or module to satisfy a particular need. It will not satisfy the die hard DP user who wants it all but there are DP programs out there that do this so why complicate XY tab principles for a few special needs. I urge Don to explore this approach as a very feasible solution to satisfy most DP wishes (90%) and the remaining 10% will have to revert to a DP only program.
Here's a variation: This one sends the current tab and the next one. Of course, these scripts are useful for whatever external programs that can accept more than one file/path for whatever reason.jacky wrote:Well, I don't use WinMerge, but I actually like the idea of using the Tab list that way, that's a nice idea
"WinMerge2:WinMerge2"
set $first, <curpath>;
seltab +;
set $second, <curpath>;
seltab -;
set $cmd, """D:\Software\WinMerge\WinMerge.exe"" /e /r /f ""*.*"" """;
addstr $cmd, $first, """ """, $second , """";
open $cmd;
here is my 'open with' UDC that I have setup using winmerge.
"C:\Program Files\WinMerge\WinMergeU.exe" "<items>" "<clipboard>"
It will work comparing files or folders. I used the clipboard so I would not be required to be in the same tab to do comparisons but that causes an issue if comparing large directories. Overall it works well for me though.
I should probably improve it by using some scripting. maybe I will do that now.
"C:\Program Files\WinMerge\WinMergeU.exe" "<items>" "<clipboard>"
It will work comparing files or folders. I used the clipboard so I would not be required to be in the same tab to do comparisons but that causes an issue if comparing large directories. Overall it works well for me though.
I should probably improve it by using some scripting. maybe I will do that now.
-
- Site Admin
- Posts: 60288
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Why "<items>"? (= all selected items) More suitable would be <curitem> (= the one selected and focused item).eurytos wrote:here is my 'open with' UDC that I have setup using winmerge.
"C:\Program Files\WinMerge\WinMergeU.exe" "<items>" "<clipboard>"
It will work comparing files or folders. I used the clipboard so I would not be required to be in the same tab to do comparisons but that causes an issue if comparing large directories. Overall it works well for me though.
I should probably improve it by using some scripting. maybe I will do that now.
FAQ | XY News RSS | XY Twitter
Using "<items>" gives me the ability to also select two items/folders in the same tab without needing to copy one to the clipboard. I don't think that would work if I used <curitem>admin wrote:Why "<items>"? (= all selected items) More suitable would be <curitem> (= the one selected and focused item).eurytos wrote:here is my 'open with' UDC that I have setup using winmerge.
"C:\Program Files\WinMerge\WinMergeU.exe" "<items>" "<clipboard>"
It will work comparing files or folders. I used the clipboard so I would not be required to be in the same tab to do comparisons but that causes an issue if comparing large directories. Overall it works well for me though.
I should probably improve it by using some scripting. maybe I will do that now.
-
- Site Admin
- Posts: 60288
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Ah, I see! And what if you select two items and there's something on the clipboard? How does winmerge handle this?eurytos wrote:Using "<items>" gives me the ability to also select two items/folders in the same tab without needing to copy one to the clipboard. I don't think that would work if I used <curitem>admin wrote:Why "<items>"? (= all selected items) More suitable would be <curitem> (= the one selected and focused item).eurytos wrote:here is my 'open with' UDC that I have setup using winmerge.
"C:\Program Files\WinMerge\WinMergeU.exe" "<items>" "<clipboard>"
It will work comparing files or folders. I used the clipboard so I would not be required to be in the same tab to do comparisons but that causes an issue if comparing large directories. Overall it works well for me though.
I should probably improve it by using some scripting. maybe I will do that now.
FAQ | XY News RSS | XY Twitter
It takes the first two items and then ignores the clipboard (or at least don't give me a visible error). The functionality wouldn't work the same if I swapped <clipboard> and <items>, then it would take the clipboard and 1 item.admin wrote:Ah, I see! And what if you select two items and there's something on the clipboard? How does winmerge handle this?eurytos wrote:Using "<items>" gives me the ability to also select two items/folders in the same tab without needing to copy one to the clipboard. I don't think that would work if I used <curitem>admin wrote:Why "<items>"? (= all selected items) More suitable would be <curitem> (= the one selected and focused item).eurytos wrote:here is my 'open with' UDC that I have setup using winmerge.
"C:\Program Files\WinMerge\WinMergeU.exe" "<items>" "<clipboard>"
It will work comparing files or folders. I used the clipboard so I would not be required to be in the same tab to do comparisons but that causes an issue if comparing large directories. Overall it works well for me though.
I should probably improve it by using some scripting. maybe I will do that now.
Re: XY + WinMerge
Just for the record, to compare two selected files in the active pane, here is a one-liner:
and to compare two files which are in a different pane
Code: Select all
::run """C:\Programme\WinMerge\WinMergeU.exe"" /e /r ""<get SelectedItemsPathNames """""" """""">""";
Code: Select all
::run """C:\Programme\WinMerge\WinMergeU.exe"" /e /r ""<get item 1>"" ""<get item 2>""";
-
- Site Admin
- Posts: 60288
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: XY + WinMerge
This looks so frightening that I think about adding something like SelectedItemsPathNamesAsQuotedItemsList...leinad wrote:Just for the record, to compare two selected files in the active pane, here is a one-liner:
Code: Select all
::run """C:\Programme\WinMerge\WinMergeU.exe"" /e /r ""<get SelectedItemsPathNames """""" """""">""";
FAQ | XY News RSS | XY Twitter
Re: XY + WinMerge
Don't steal me my usualSelectedItemsPathNamesAsQuotedItemsList...
formatlist()
^^
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de
Re: XY + WinMerge
Just an "update" to the code here. Well too bad it's not a one-liner but at least you can now select either files from the same pane or a single file from each pane to compare. And it does it smartly too so if you selected 2 files in the current pane, it will compare those. If you select only 1 file, it will look for another selected item in the other pane and compare the 2. If you selected more than 2 files on the same pane, it will throw you an error. If you selected 1 but more than 1 file on the other pane (total more than 2), it will also throw an error.
Code: Select all
"WinMerge"
$Executable = "C:\Users\Owner\Programs\Other\WinMerge\WinMergePortable.exe";
End ("<selitems>"==""),"Nothing Is Selected!";
If Get("CountSelected") == 1 {
$Count1 = Get("CountSelected", "1"); $Count2 = Get("CountSelected", "2");
If ($Count1 > 1 || $Count2 > 1) {Msg "No More Than 2 Items can Be Selected!"; End(1);}
Else {$SelectedItems = "<get item 1>|<get item 2>";} }
ElseIf Get("CountSelected") > 2 {Msg "No More Than 2 Items can Be Selected!"; End(1);}
Else {$SelectedItems = Get("SelectedItemsPathNames","|");}
$File1 = GetToken("$SelectedItems",1,"|"); $File2 = GetToken("$SelectedItems",2,"|");
Run """$Executable"" /e /r ""$File1"" ""$File2"""; }
"BeyondCompare"
$Executable = "C:\Users\Owner\Programs\Other\Beyond Compare\BCompare.exe";
End ("<selitems>"==""),"Nothing Is Selected!";
If Get("CountSelected") == 1 {
$Count1 = Get("CountSelected", "1"); $Count2 = Get("CountSelected", "2");
If ($Count1 > 1 || $Count2 > 1) {Msg "No More Than 2 Items can Be Selected!"; End(1);}
Else {$SelectedItems = "<get item 1>|<get item 2>";} }
ElseIf Get("CountSelected") > 2 {Msg "No More Than 2 Items can Be Selected!"; End(1);}
Else {$SelectedItems = Get("SelectedItemsPathNames","|");}
$File1 = GetToken("$SelectedItems",1,"|"); $File2 = GetToken("$SelectedItems",2,"|");
Run """$Executable"" /e /r ""$File1"" ""$File2"""; }
Re: XY + WinMerge
Whoa, thanks a lot.
This is much more versatile than my own clunky solution. And I learned some valuable scripting stuff as well. This deserves a permanent place in the scripts overview, imo.
This is much more versatile than my own clunky solution. And I learned some valuable scripting stuff as well. This deserves a permanent place in the scripts overview, imo.
Re: XY + WinMerge
Thanks Enternal, I just DL'ed WinMerge to give this a try.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440