Page 1 of 1
help with <item1> <item2> ........
Posted: 18 Apr 2008 18:05
by eurytos
I have setup a UDC to open winmerge and load the selected file/folder (or 2 files/folders) into the program. This works fine as long as the file/folder are in the same location. I am having problems selecting the two items if they are in separate tabs or separate folders in the same tab.
The path to one of the items ends with <item2> instead of the filename.
eg:
\\Dal-fsdev\e$\psoft\FSDEV\appserv\FSDEV\psappsrv.cfg
\\Dal-fsdev\e$\psoft\FSDEV\appserv\FSDEV\<item2>
Is there a short-cut key I am missing to load a selected item into <item1>, <item2>, etc? I am guessing the problem is because the selected item does not stick when i change folders or tabs.
Here is my UDC in case I set it up poorly.
"C:\Program Files\WinMerge\WinMergeU.exe" "<item1>" "<item2>"
Posted: 18 Apr 2008 18:34
by jacky
hmm.. that's a weird one, really. I'd even say impossible
First, you can't work it with items on different tabs, since obviously anything in XY can only relate to selection on the current/active tab, not what's selected on any other tab.
As for items in different locations in the same tab, it should work fine. I just tried it, and it works fine here. <item1> is replaced by the full path/name of the first item, and <item2> by the full path/name of the second one. Of course, if there's only one item selected, it remains <item2> but I don't see how you could get XY to replace it with the path of the item, and then <item2> instead of its name

Are you sure it wasn't just <item2> when only one item was selected ?
Posted: 18 Apr 2008 19:01
by eurytos
I only have problems in the same tab if I am trying to select items in different subfolders.
If I am comparing two items in the same folder I have no issues.
Once again this could be something that is not possible since I don't know how one would keep an item selected and navigate through folders.
Posted: 18 Apr 2008 19:06
by bergfex
Copy the "Item Path/Name" of the first file to the clipboard with CTRL-P, then select the second file and start the OpenWith-UDC (with another KS):
"C:\Program Files\WinMerge\WinMergeU.exe" <curitem> <clipboard>
Posted: 18 Apr 2008 19:26
by bergfex
Better would be the OpenWith-UDC:
"C:\Program Files\WinMerge\WinMergeU.exe" "<items>" "<clipboard>"
If you select only one file/folder, than it is compared to the path on the clipboard. If you select two files/folders on the list you can still use the same UDC to compare these two files/folders.
Posted: 18 Apr 2008 20:09
by eurytos
omg!
Thanks so much bergfex!!!
That worked perfectly with one problem that may not be solvable without a script. It is swapping my first and second selected when it shows in the compare.
It is no big deal I will just need to remember that the left hand side is going to be the second file selected.
Or I guess I could always copy the first item and this would work:
"C:\Program Files\WinMerge\WinMergeU.exe" "<clipboard>" "<items>"
But, thanks again that helped a ton!
Posted: 18 Apr 2008 20:27
by bergfex
eurytos wrote:Or I guess I could always copy the first item and this would work:
"C:\Program Files\WinMerge\WinMergeU.exe" "<clipboard>" "<items>"
Yes, of course. If you prefer it that way just use:
"C:\Program Files\WinMerge\WinMergeU.exe" "<clipboard>" "<curitem>"
I'm glad I could help.

Posted: 18 Apr 2008 20:39
by admin
bergfex wrote:"C:\Program Files\WinMerge\WinMergeU.exe" "<clipboard>" "<curitem>"
Cute idea to use <clipboard> here, bergfex!

Posted: 18 Apr 2008 21:14
by bergfex
admin wrote:bergfex wrote:"C:\Program Files\WinMerge\WinMergeU.exe" "<clipboard>" "<curitem>"
Cute idea to use <clipboard> here, bergfex!

Thank you, Don.

The great thing is that with your excellent Help file and the wonderful XYwiki (thanks, jacky) it is even possible for amateurs like me to craft some useful UDC/scripts. You proved once more that powerful features and simplicity/usability don't have to contradict each other.