Right now (v8.70.0151 - 2009-12-16) you have to do an little trick (FYI: >Here< it is discussed to implement tokens for this issue.)
to provide items from both panes to this app:
* First get the name of the path/item of the first pane,
* then switch the focus to the other pane,
* now get the name of the path/item from this other pane.
* Maybe, if you want, switch focus back to first pane again.
Example script:
$FileOne = <curitem>;
Focus "PI"; //switch focus to other pane
$FileTwo = <curitem>;
Focus "PI"; //switch focus back (if needed)
>Here< is an list of all Script_Variables.
********************************************************************
Example script:EDIT: there are now new vars for that issue wrote:v8.70.0152 - 2009-12-17 15:28
+ New variable <get path [pane]> returns the unslashed path of any of the two panes.
For example: <get path> //active pane's path || <get path i> //inactive pane's path
$FileOne = <get path>; //active pane's path
$FileTwo = <get path i>; //inactive pane's path
********************************************************************
Here i have done an try to integrate "Beyond Compare" (or WinMerge) as comparing tool into my XYplorer setup:
1.) save the "BCompare.xys" from below into an plain text file named "BCompare.xys" in your XYplorer\Scripts -folder
2.) to launch that script you have several possibilities, e.g. adding an new toolbar button: 3.) If you launch the script you will see an new dialog popping up: Just click at an item to launch BeyondCompare with the selected files/folders as parameter.
(Note: just modify the "_Execute" section to launch an other application like WinMerge)
BCompare.xys
Code: Select all
/*
Execute Beyond Compare
BCompare_20091210.xys
LICENSE:
This script is free software: you can redistribute and/or modify it.
This script is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
If your computer implode or your files gets lose, don't blame me, so
please try this script first with some test files in an virtual machine.
Purpose:
Script to launch external tool with selected files/folders as parameter
How to use:
1.) Copy the script below in an file "..\scripts\BCompare.xys".
2.) Then, e.g., add an CTB toolbar button:
Name: BCompare
Icon: path\to\Beyond Compare 3\BCompare.exe
On Click: load BCompare;
3.) Select two files or folders in XY.
4.) execute this script.
5.) you are prompted with an menu
*/
// the script:
"Run BCompare with..."
"... Current open Folders from L/R pane"
Global $ArgOne, $ArgTwo;
$ArgOne = <curpath>;
Focus "PI";
$ArgTwo = <curpath>;
Focus "PI";
Sub "_Execute";
"... Selected Files or Folders from L/R pane"
Global $ArgOne, $ArgTwo;
End ("<curitem>"==""), "No file selected!"; //check if any file is selected
$ArgOne = <curitem>;
Focus "PI";
End ("<curitem>"==""), "No file selected!"; //check if any file is selected
$ArgTwo = <curitem>;
Focus "PI";
Sub "_Execute";
"... Selected Files or Folders from same pane"
Global $ArgOne, $ArgTwo;
$SelectedFiles = getinfo("SelectedItemsPathNames","|");
$ArgOne = gettoken($SelectedFiles, 1, "|");
$ArgTwo = gettoken($SelectedFiles, 2, "|");
Sub "_Execute";
"_Execute"
Global $ArgOne, $ArgTwo;
end (exists("<xypath>\..\Beyond Compare 3\BCompare.exe")=="0"), "BCompare.exe not found.<crlf>Edit script and check path.";
run "<xypath>\..\Beyond Compare 3\BCompare.exe" "$ArgOne" "$ArgTwo";
//run "<xypath>\..\WinMerge\App\WinMerge\WinMergeU.exe" "$ArgOne" "$ArgTwo";
-
"Cancel"
-
"Edit this &script : edit"
self $ScriptFile, file;
OpenWith "<xypath>\Tools\NotePad2\Notepad2.exe", ,$ScriptFile;
BTW, i have seen >here< an similar script.
Edit: added some more comments.