Page 1 of 1

I need a (very) simple script...

Posted: 15 Aug 2012 16:02
by Ysl
Hello you all brilliant programmers

I would like a script which would select all the files in the current pane and move them one folder up

thanks for your help !

Re: I need a (very) simple script...

Posted: 15 Aug 2012 16:09
by highend

Code: Select all

    sel a; #1056;
Moves all files and folders from the current directory one level up.

Code: Select all

    sel f; #1056;
If you want to move only files (and no folders).

Re: I need a (very) simple script...

Posted: 15 Aug 2012 16:35
by serendipity
There is the option to right-click > Move up if you prefer that over script.

Re: I need a (very) simple script...

Posted: 19 Aug 2012 10:59
by kiwichick
Hi there, What would you use to move only folders? Cheers.

Re: I need a (very) simple script...

Posted: 19 Aug 2012 12:36
by highend

Code: Select all

sel f; sel i; #1056;

Re: I need a (very) simple script...

Posted: 20 Aug 2012 00:37
by kiwichick
Of course, Invert Selection! Thanks!

Re: I need a (very) simple script...

Posted: 20 Aug 2012 21:17
by Ysl
Sorry for being late to thank you all for your help !

Re: I need a (very) simple script...

Posted: 18 Oct 2012 16:37
by BJosephs
I see this is an old thread. But maybe someone could help me add to this script the ability to then delete the empty folder leftover from moving all the files up?
Thanks!

Re: I need a (very) simple script...

Posted: 18 Oct 2012 16:57
by highend

Code: Select all

$path = <curpath>;
  $parent = regexreplace($path, "(.*(?=\\))(.*)", "$1");
  sel a; #1056; goto $parent; delete 1, 0, $path;

Re: I need a (very) simple script...

Posted: 19 Oct 2012 03:44
by BJosephs
Nice! Thanks!

Re: I need a (very) simple script...

Posted: 31 May 2021 15:38
by sl23
Great script, thank you.

May I ask, how would you only move selected files up and then delete the folder please.
Thank you

Re: I need a (very) simple script...

Posted: 31 May 2021 15:48
by highend
What does #1056; do?
Try it out!

and then you can answer that question yourself...

Re: I need a (very) simple script...

Posted: 31 May 2021 16:20
by sl23
highend wrote: 31 May 2021 15:48 What does #1056; do?
Try it out!

and then you can answer that question yourself...
Thank you. Ok I see that you select and use #1056 to move them up, but the code you supplied doesn't do that. But then you changed it considerably from sel a; #1056; to: $path = <curpath>; $parent = regexreplace($path, "(.*(?=\\))(.*)", "$1"); sel a; #1056; goto $parent; delete 1, 0, $path;.

So I was lost as to how to do both but with only selected files.

Using sel a; #1056; doesn't require you to select any files and in fact, even when selected the selection is ignored and all files are moved.

EDIT: Alright I see that sel a; selects all files. So I need to remove that? Ok, smarty! :P That worked, Thanks.