Page 1 of 1
Should <curitem> return the current path?
Posted: 16 Mar 2008 13:05
by admin
Should <curitem> return the current path in case no item in list is selected/focused? Right now it returns an empty string in that case.
I'd say yes!
Posted: 16 Mar 2008 13:44
by graham
I am not sure on this, as returning an emty string does prevent, say, a script using this and deleting or altering file content unexpectidly. That said, it is not something I have used much so not the best qualified on its application.
Re: Should <curitem> return the current path?
Posted: 16 Mar 2008 13:52
by jacky
Yeah I agree that it may sound "weird", and as I was questioning myself I thought that since Ctrl+P right now works that way (current path if no item selected), maybe it should, too.
But I'm not so sure and would say "no" in fact, because <curitem> refers to the currently focused&selected List item, where as Ctrl+P refers to "the full path/name of all selected Tree or List items", so it is pretty different and makes more sense then, since if nothing on List is available it goes back to Tree.
<curitem> does seem to be in a quite different situation, as it only refers to list, so never returns a (/the current) path. No "current item", then nothing returned (empty string). Makes more sense to me like that, plus goes along with other variales such as <curext>, <curbase>, etc
Re: Should <curitem> return the current path?
Posted: 16 Mar 2008 18:08
by admin
Okay, I expected resistance from the purists.
So I'll add another variable <cur> which will return either the current list item or, if none, the current path.
You know why I want it? I need it for my
convert <cur> to URL script. I want to use the same script and keyboard shortcut for tree and list.
Re: Should <curitem> return the current path?
Posted: 25 Oct 2013 10:30
by yusef88
admin wrote:Okay, I expected resistance from the purists.
So I'll add another variable <cur> which will return either the current list item or, if none, the current path.
You know why I want it? I need it for my
convert <cur> to URL script. I want to use the same script and keyboard shortcut for tree and list.
sorry for the inconvenience..where is it?
cant find it in the xyplorer help, variables section.
Re: Should <curitem> return the current path?
Posted: 25 Oct 2013 11:12
by Stefan
In the past 5 1/2 years there has many things changed (if it was implemented at all?).
If you need such a var, maybe you can utilize such a code?
Code: Select all
::if("<curitem>"==""){$cur="<curpath>";}else{$cur="<curitem>";} msg $cur;
or formated another way
Code: Select all
if( "<curitem>" == "" ){
$cur = "<curpath>";
}else{
$cur = "<curitem>";
}
msg $cur;
(see XYplorer Help > "Advanced Topics > Variables" for more XYplorer Native Variables)
.