Page 1 of 1

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

Posted: 07 Apr 2017 22:48
by Vocalpoint
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

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

Posted: 07 Apr 2017 23:20
by highend

Code: Select all

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

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

Posted: 08 Apr 2017 00:53
by Vocalpoint
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

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

Posted: 08 Apr 2017 01:04
by highend
Hundreds of possibilities...

How do you want to select the target?

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

Posted: 08 Apr 2017 06:02
by Vocalpoint
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

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

Posted: 08 Apr 2017 06:22
by highend
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;

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

Posted: 08 Apr 2017 14:07
by Vocalpoint
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