Can XYplorer take contents of several folders and move to a single folder?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Vocalpoint
Posts: 139
Joined: 06 Nov 2009 14:01

Can XYplorer take contents of several folders and move to a single folder?

Post by Vocalpoint » 07 Apr 2017 22:48

I have situation where a batch process (from an audio app) is creating separate folders with an mp3 file in each folder.

Is there any way (Or script) in XY that would let me select 10 folders and somehow move just the contents of those 10 folders to a single target location?

Even better would be to have XY clean up the empty folders afterwards...:)

Any tips or scripts out there?

Appreciate any help.

Cheers!

VP

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

Re: Can XYplorer take contents of several folders and move to a single folder?

Post by highend » 07 Apr 2017 23:20

Code: Select all

    setting "BackgroundFileOps", 0;
    $selection = <get SelectedItemsPathNames |>;
    copyto "R:\destination", quicksearch("/maxdepth=0", $selection, "|"), , 2, 2, 4);
    delete 1, 0, $selection;
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

Vocalpoint
Posts: 139
Joined: 06 Nov 2009 14:01

Re: Can XYplorer take contents of several folders and move to a single folder?

Post by Vocalpoint » 08 Apr 2017 00:53

highend wrote:

Code: Select all

    setting "BackgroundFileOps", 0;
    $selection = <get SelectedItemsPathNames |>;
    copyto "R:\destination", quicksearch("/maxdepth=0", $selection, "|"), , 2, 2, 4);
    delete 1, 0, $selection;
Awesome.

So how do use this to transfer to the target?

While I see "R:\Destination" in here - that will never be the name of the target. And I do not want to have to edit the script each time - or is that the only option?

A tad confused on usage with this one...?

Appreciate any additional info.

Cheers!

VP

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

Re: Can XYplorer take contents of several folders and move to a single folder?

Post by highend » 08 Apr 2017 01:04

Hundreds of possibilities...

How do you want to select the target?
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

Vocalpoint
Posts: 139
Joined: 06 Nov 2009 14:01

Re: Can XYplorer take contents of several folders and move to a single folder?

Post by Vocalpoint » 08 Apr 2017 06:02

highend wrote:Hundreds of possibilities...

How do you want to select the target?
Ideally? I would love it if I could:

1. Highlight a bunch of folders
2. Hit a shortcut key to fire up the script
3. Have an input box appear - so I can create a folder name
4. Click OK
5. Script moves contents of selected folders into new folder I created

Realistically?

I guess I could live with a folde created within the script itself - I could simply choose a generic folder name and create it everytime
I would still need to highlight a series of folders and fire the script via shortcut.

Make sense?

VP

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

Re: Can XYplorer take contents of several folders and move to a single folder?

Post by highend » 08 Apr 2017 06:22

Set the $defaultFolderName as you like
Rest should work as desired...

Code: Select all

    $defaultFolderName = "Destination";

    setting "BackgroundFileOps", 0;
    $destination = input("Create destination folder...", , "<curpath>\$defaultFolderName");
    if !($destination) { status "No destination folder given, aborted!", "8B4513", "stop"; end true; }
    if !(regexmatches($destination, ":|\\\\")) { $destination = "<curpath>\$destination"; }
    $selection = <get SelectedItemsPathNames |>;
    copyto $destination, quicksearch("/maxdepth=0", $selection, "|"), , 2, 2, 4);
    delete 1, 0, $selection;
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

Vocalpoint
Posts: 139
Joined: 06 Nov 2009 14:01

Re: Can XYplorer take contents of several folders and move to a single folder?

Post by Vocalpoint » 08 Apr 2017 14:07

highend wrote:Set the $defaultFolderName as you like
Rest should work as desired...

Code: Select all

    $defaultFolderName = "Destination";

    setting "BackgroundFileOps", 0;
    $destination = input("Create destination folder...", , "<curpath>\$defaultFolderName");
    if !($destination) { status "No destination folder given, aborted!", "8B4513", "stop"; end true; }
    if !(regexmatches($destination, ":|\\\\")) { $destination = "<curpath>\$destination"; }
    $selection = <get SelectedItemsPathNames |>;
    copyto $destination, quicksearch("/maxdepth=0", $selection, "|"), , 2, 2, 4);
    delete 1, 0, $selection;
Wow! Thank you so much. It is exactly perfect!

VP

Post Reply