Page 1 of 1

I wish "GOTO .." worked like the Help says...

Posted: 12 Jul 2014 00:20
by Papoulka
I was working on a script to move selected files into a parent folder, and ran into many problems. I eventually found this thread:

http://www.xyplorer.com/xyfc/viewtopic. ... ent#p49071

and got things working.

But before that I was stumped for a long time by the fact that Goto ".." seemed to be broken. Even with focus on the list I was working in, it would go off to the parent of my XY home folder! That was completely unexpected and, more confusing,contrary to what the Help says:
goto location, [reuseexistingtab]
location: [Required] A path, a file, a Quick Search, a Visual Filter, or a URL ... whatever is accepted in the Address Bar,
If I type ".." in the Address Bar, it goes to the immediate parent folder - as I would expect and was trying to do in my script. But used in a script, it just runs home to mama.

I thought this must have been debated to death already, because on the surface it is so strange, but didn't find anything.

So I suggest, have Goto ".." work the same in a script as in the Address Bar.

Thanks

Re: I wish "GOTO .." worked like the Help says...

Posted: 12 Jul 2014 00:47
by PeterH
Hm.

Try to type goto '..'; into the address bar :roll:

(OK: not what you wanted to read 8) )

Re: I wish "GOTO .." worked like the Help says...

Posted: 12 Jul 2014 01:11
by TheQwerty
I don't recall where and cannot currently check but somewhere there is an option to make paths relative to the current path instead of the app path.

Re: I wish "GOTO .." worked like the Help says...

Posted: 12 Jul 2014 01:37
by nerdweed
Its here

Configuration -> Controls & More -> Miscellaneous -> Address bar relative to application path

Re: I wish "GOTO .." worked like the Help says...

Posted: 12 Jul 2014 03:46
by Papoulka
.
Thanks, but that checkbox in Controls & More is already un-checked. And it isn't the issue, anyway. I want the Address Bar to keep working as it does: absolute path.

The problem is with the scripting Goto command. It doesn't use the absolute path, even as a switch or option [ideas...].

Re: I wish "GOTO .." worked like the Help says...

Posted: 12 Jul 2014 05:56
by bdeshi
moved to bug reports... admins feel free to move to a better place

Re: I wish "GOTO .." worked like the Help says...

Posted: 12 Jul 2014 05:59
by bdeshi
goto ".." isn't relative to <curpath> even from the AB.

Re: I wish "GOTO .." worked like the Help says...

Posted: 12 Jul 2014 08:31
by Papoulka
.
Well, if I type ".." into the Address Bar, it goes to the parent folder. I think (and the Help says) that means the script statement:

Goto "..";

will go to the parent folder. Just like:

Moveto "..";

will move stuff to the parent folder.

Regardless of the Help file, it just makes sense (to me). And besides it would be very useful since AFAIK there is no easy way to simply go to a parent folder! That's all I wanted to do, and this is certainly the most natural command to use for that.

Re: I wish "GOTO .." worked like the Help says...

Posted: 12 Jul 2014 10:12
by admin
SC goto is relative to <xypath> (path of XYplorer.exe).

This info is indeed missing from the Help, so thanks for the hint.

Re: I wish "GOTO .." worked like the Help says...

Posted: 12 Jul 2014 13:50
by bdeshi
wouldn't it be better to make goto relative to <curpath>?

Re: I wish "GOTO .." worked like the Help says...

Posted: 12 Jul 2014 16:17
by PeterH
SammaySarkar wrote:wouldn't it be better to make goto relative to <curpath>?
I don't remember, why it was made as it is. Perhaps Don does?

But I also think there would be advantages to change it. I think it's as in old DOS days: you accessed a program directory by specifying it explicitely, or via the path= definitions. And the current path was preferibly used to access the data. For me this makes sense.

Re: I wish "GOTO .." worked like the Help says...

Posted: 13 Jul 2014 09:56
by admin
1) Just as an aside: There is a setting for this for the Address Bar:
Configuration | Controls and More | Miscellaneous | Address Bar relative to application path
But I would not make scripts behavior dependent on a user setting.

2) Not sure. And it might break scripts. Hmm...

Re: I wish "GOTO .." worked like the Help says...

Posted: 13 Jul 2014 16:27
by TheQwerty
There are so many solutions to this that I don't think XY should change at all...

Code: Select all

goto "<xypath>\..";
goto "<curpath>\..";
There's the go up command ID, or you could use GetPathComponent to get the parent and go there.

Re: I wish "GOTO .." worked like the Help says...

Posted: 14 Jul 2014 00:41
by Papoulka
Thanks, TheQwerty

I was doing it a much harder way; saving a variable with some regex path extraction statement. Saw that in the only script I ran across that relocated to a parent folder. If I had known it was as simple as:

Code: Select all

goto "<curpath>\..";
I wouldn't have posted the wish.

I agree that XY shouldn't be changed as it would break earlier scripts. And given the above function there is no need to add anything new. It might be worth adding this to the Help, however, as the workaround for goto ".." not inherently using <curpath>.