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: 163
Joined: 06 Nov 2009 14:01

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

Post 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

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

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

Post 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;
One of my scripts helped you out? Please donate via Paypal

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

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

Post 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

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

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

Post by highend »

Hundreds of possibilities...

How do you want to select the target?
One of my scripts helped you out? Please donate via Paypal

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

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

Post 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

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

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

Post 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;
One of my scripts helped you out? Please donate via Paypal

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

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

Post 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

Post Reply