UDC: Variable for item of inactive panel
-
MBaas
- Posts: 692
- Joined: 15 Feb 2016 21:08
UDC: Variable for item of inactive panel
I'd like to set up a UDC to launch a Compare-Tool, giving it the current item of the 1st and 2nd panel.I found <curitem> - but how can I refer to the item in the 2nd panel?
-
highend
- Posts: 14994
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: UDC: Variable for item of inactive panel
Welcome to the club.
Code: Select all
$item = gettoken(get("SelectedItemsPathNames", "|", "i"), 1, "|");One of my scripts helped you out? Please donate via Paypal
-
MBaas
- Posts: 692
- Joined: 15 Feb 2016 21:08
Re: UDC: Variable for item of inactive panel
Thanks for the welcome and the quick solution :-)
I'm a total newbie, so pls. forgive the silly question, but I do not see how to apply your code? My idea was to set up a UDC "Open with" - where <curitem> can be put in the "Application"-field. But your code looks like I should write a script and embed that, is that right?
I wonder why the 2nd panel is accessed so differently from the 1st. Is my way of using XY so untypical that this idea never came up? Would the task of comparing the current file or folder to another one by calling an external utiity be better addressed in another way, is there a XY-style of doing such operations on 2 items?
I'm a total newbie, so pls. forgive the silly question, but I do not see how to apply your code? My idea was to set up a UDC "Open with" - where <curitem> can be put in the "Application"-field. But your code looks like I should write a script and embed that, is that right?
I wonder why the 2nd panel is accessed so differently from the 1st. Is my way of using XY so untypical that this idea never came up? Would the task of comparing the current file or folder to another one by calling an external utiity be better addressed in another way, is there a XY-style of doing such operations on 2 items?
-
highend
- Posts: 14994
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: UDC: Variable for item of inactive panel
Sorry, yeah, it's meant for a script. Not all variables that XYplorer "exposes" to the user exist for both panes. I'm using a script to compare different folders / files, etc. depending on selections, dual / single pane etc. as well.I'm a total newbie, so pls. forgive the silly question, but I do not see how to apply your code? My idea was to set up a UDC "Open with" - where <curitem> can be put in the "Application"-field. But your code looks like I should write a script and embed that, is that right?
I wonder why the 2nd panel is accessed so differently from the 1st. Is my way of using XY so untypical that this idea never came up? Would the task of comparing the current file or folder to another one by calling an external utiity be better addressed in another way, is there a XY-style of doing such operations on 2 items?
Look at it from this perspective: Even if there is a simple variable for the selected item in the non active pane... You'd still need to check if it currently contains anything to not run your comparison tool with only one parameter (and supplying an empty one as the second).
If you need help with a script, just ask.
One of my scripts helped you out? Please donate via Paypal
-
MBaas
- Posts: 692
- Joined: 15 Feb 2016 21:08
Re: UDC: Variable for item of inactive panel
Yes, that's the "super-user-friendly" way of doing it. I would have been happy with a "superuser-friendly" way (just pass that "<inactiveItem>" and assume user know what he's doing. It it's undefined and causes a crash - well, that is a "user-error") ;-)Look at it from this perspective: Even if there is a simple variable for the selected item in the non active pane... You'd still need to check if it currently contains anything to not run your comparison tool with only one parameter (and supplying an empty one as the second).
Thanks, will doIf you need help with a script, just ask.
-
TheQwerty
- Posts: 4373
- Joined: 03 Aug 2007 22:30
Re: UDC: Variable for item of inactive panel
If you can adjust your requirement from "current items" to "focused items" then you could use <get item i>. Then you can create an Open UDC that for the program with the focused items as parameters by setting the Item field similar to:You could use <focitem> instead of <get item a> if you like as they are the same.
Note however that this will not work well if you want to create an Open With UDC, because in that case XY will automatically attempt to open the active pane's current selection in addition to the arguments you provide - unless you include <items> in some way that your comparer ignores the expanded items.
Code: Select all
"?:\Path\To\Comparer\BeyondCompare\BCompare.exe" "<get item a>" "<get item i>"Note however that this will not work well if you want to create an Open With UDC, because in that case XY will automatically attempt to open the active pane's current selection in addition to the arguments you provide - unless you include <items> in some way that your comparer ignores the expanded items.
XYplorer Beta Club