Has 2 internal actions:
1. On click checks Clipboard for if there are 2 paths in it(say copied from recent added XYcopy feature) and send those to BC;
2. If check above is skipped, on first click saves path of selected item in List into perm variable - select another item and make second click on button to launch comparison.
In both actions script sends to BC a "preferred view" parameter(folder compare or text compare). The parameter is set only by checking first item in pair, so keep in mind no fool-proof on board from using 2 items of different type(folder+file pair).
I only do comparisons of texts and folders, so script determines only 2 categories(files or folders) = if anybody needs more precise differentiation, feel free to modify.
Code: Select all
"Beyond Compare Simple"
$app = """<xydrive>\Progs\BeyondCompare4.3.7\BCompare.exe""";
//Clipboard Compare
if (gettokenindex(":\",<clp>, <crlf>, "wc") == 2) {
if (confirm ("Compare CLIPBOARD ?" . <crlf> . <clp>, , , 65)){
$bcitem = gettoken(<clp>, 1, <crlf>);
$bcitem2 = gettoken(<clp>, 2, <crlf>);
if (getpathcomponent($bcitem, "ext") != "") {$cmd = '/fv="Text Compare"';} else {$cmd = '/fv="Folder Compare"';};
$bcitem = quote(quote(quote($bcitem)));
$bcitem2 = quote(quote(quote($bcitem2)));
//msg "$app $bcitem $bcitem2 $cmd";
run "$app $bcitem $bcitem2 $cmd";
}
end 1==1;
}
//Selecting items to Compare
perm $bcitem;
if ($bcitem == "") {
$bcitem = """<curitem>""";
status "BC:: $bcitem", "", "progress";
} else {
$bcitem2 = """<curitem>""";
if (get("curitem", "ext") != "") {$cmd = '/fv="Text Compare"';} else {$cmd = '/fv="Folder Compare"';};
run "$app $bcitem $bcitem2 $cmd";
unset $bcitem;
}