Copy Move to function with Dual List view

Hi,

First of all, love Directory Opus, thanks for creating it :slight_smile:

I've created a button to perform a custom function.
I want to grab a particular section of files, create a new sub-folder in current location and move those files into the new folder, leaving the rest untouched.

I've got most of the way there (the selection and folder creation), but after trying it once (seemed to work fine), I tried it on another folder and noticed that rather than put the files into the new location, it puts them into whatever directory is being displayed in the other Lister. On another occasion, it even put the files that should have been in the sub-folder from the previous run into the other lister! Most confusing. I thought it might be related to a 'selection' being left in place, so I added a deselect call at the end but it didn't help. I also tried mucking around with the ./ current file location context type thing, but to no avail.

Here's the script associated with my button. I'd like to be able to place my cursor in either the left or right lister (or the main one if only showing one), press this button and it works.

Script:

// deselect everything to start with
Select * Deselect
// select files we want in main dir (every song file without a track number)
Select [0123456789]*.flac
// select everything else now
Select Invert
// need to DEselect any folders (want them left as is)
Select ALLDIRS Deselect
// move everything to "asd" folder
//Copy MOVE TO "./asd"
Copy MOVE CREATEFOLDER "asd"
// clear selection for next time
Select * Deselect

Thanks for any help in advance!

The main thing is you want the Copy command to have the HERE argument, so it copies into/relative to the source folder instead of the destination folder.

You can also reduce things to fewer commands:

Select ALLDIRS DESELECT Select ~([0123456789]*.flac) TYPE=files DESELECTNOMATCH Copy MOVE HERE CREATEFOLDER="asd"

THANK YOU VERY MUCH! :smiley: