help with <item1> <item2> ........

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
eurytos
Posts: 200
Joined: 29 Jan 2008 15:53

help with <item1> <item2> ........

Post 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>"

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Post 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 ?
Proud XYplorer Fanatic

eurytos
Posts: 200
Joined: 29 Jan 2008 15:53

Post 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.

bergfex
Posts: 188
Joined: 07 Sep 2007 19:06

Post 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>
**** Abandoned Account ****

bergfex
Posts: 188
Joined: 07 Sep 2007 19:06

Post 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.
**** Abandoned Account ****

eurytos
Posts: 200
Joined: 29 Jan 2008 15:53

Post 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!

bergfex
Posts: 188
Joined: 07 Sep 2007 19:06

Post 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. :wink:
**** Abandoned Account ****

admin
Site Admin
Posts: 66075
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Post by admin »

bergfex wrote:"C:\Program Files\WinMerge\WinMergeU.exe" "<clipboard>" "<curitem>"
Cute idea to use <clipboard> here, bergfex! :D

bergfex
Posts: 188
Joined: 07 Sep 2007 19:06

Post by bergfex »

admin wrote:
bergfex wrote:"C:\Program Files\WinMerge\WinMergeU.exe" "<clipboard>" "<curitem>"
Cute idea to use <clipboard> here, bergfex! :D
Thank you, Don. :P
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.
**** Abandoned Account ****

Post Reply