I need a (very) simple script...

Discuss and share scripts and script files...
Post Reply
Ysl
Posts: 150
Joined: 03 Jan 2007 22:22

I need a (very) simple script...

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

highend
Posts: 13260
Joined: 06 Feb 2011 00:33

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

Post 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).
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

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

Post by serendipity »

There is the option to right-click > Move up if you prefer that over script.

kiwichick
Posts: 557
Joined: 08 Aug 2012 04:14
Location: Pahiatua, New Zealand

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

Post by kiwichick »

Hi there, What would you use to move only folders? Cheers.
Windows 10 Pro 22H2

highend
Posts: 13260
Joined: 06 Feb 2011 00:33

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

Post by highend »

Code: Select all

sel f; sel i; #1056;
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

kiwichick
Posts: 557
Joined: 08 Aug 2012 04:14
Location: Pahiatua, New Zealand

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

Post by kiwichick »

Of course, Invert Selection! Thanks!
Windows 10 Pro 22H2

Ysl
Posts: 150
Joined: 03 Jan 2007 22:22

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

Post by Ysl »

Sorry for being late to thank you all for your help !

BJosephs
Posts: 6
Joined: 07 Sep 2012 00:41

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

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

highend
Posts: 13260
Joined: 06 Feb 2011 00:33

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

Post by highend »

Code: Select all

$path = <curpath>;
  $parent = regexreplace($path, "(.*(?=\\))(.*)", "$1");
  sel a; #1056; goto $parent; delete 1, 0, $path;
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

BJosephs
Posts: 6
Joined: 07 Sep 2012 00:41

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

Post by BJosephs »

Nice! Thanks!

sl23
Posts: 223
Joined: 03 Feb 2015 23:34

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

Post 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

highend
Posts: 13260
Joined: 06 Feb 2011 00:33

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

Post by highend »

What does #1056; do?
Try it out!

and then you can answer that question yourself...
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

sl23
Posts: 223
Joined: 03 Feb 2015 23:34

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

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

Post Reply