Command: SelectEx (extended Select command)

Indeed there are! o) If there's still something left I can do, let me know! o)

Btw: The new AutoSelect.DeselectNoMatch feature comes with a condition for you, the next time you encounter problems, please report asap right here - in the interests of all of us - and to raise general satisfaction, deal? o)

:thumbsup: Congratulations @tbone on a fine piece of work.

Regards, AB

One suggestion for the Autoselect part: Maybe the existing autoselect paths could be backed up in some other place, so if we update script versions, we could retrieve them from there. At the moment, each new version starts empty, having only the default examples.

As long as the script's filename is unchanged, any settings should remain.
Did you rename or alter the script's filename after/before updating?

Hmm, that could be the reason, indeed. I'm not aware, which change i made recently to the older version, but i don't recall having had that replace dialog last time, when i updated. Which indicates, that you must be right. Thanks again!

Good! o) Btw, this is why I once suggested that DO should rely on a script-internal identifier, instead of the scripts filename to identify scripts and their settings. I guess many users are not aware, that they screw their (script) configurations and existing column setups if they rename scripts that were already in use. Regarding v11.5.1

tbone, i just had another idea for the "auto select" part. I would suggest an additional option to prevent the auto select action, in case we move out of a folder, instead of moving into it, which i see as the standard case. Does that make sense to anybody else?

This suggestion also applies to Leo's original "standalone" version, of course. :bulb:

Kind of makes sense, yes.. I'll have a look. o)

Updated to v0.5:

  • new switch "INDEST", select items in destination instead of source (for SIMILARMETA/JS only)
  • missing output fixed for DO versions older than v11.13.1
  • new script config "AutoSelect.Actions" to customize on what type of folderchange the autoselection is done
  • new features for the FOLDERS switch in combination with RECURSE and PATH
    -> depthmin/depthmax to limit results to folders with a specific distance to the source folder
    -> subfldmin/subfldmax to limit results to folders with a specific number of subfolders
    -> skipsubfld to pre-filter/exclude all (sub)folders for which the subfldmin/max criteria already matched

The new INDEST switch is similar to the native "Select SOURCETODEST=noext", but allows custom rules for determining the items to be selected. This command selects all items in dest, which names are equal up to the 8th digit from the selected items in source.

SelectEx SIMILARMETAJS="return selItem.name.left(8)==item.name.left(8);" INDEST

The new features for the FOLDER switch allow to limit randomly or linearly picked folders by their number of subfolders or distance to the source. This command picks 10 random folders, that do not contain any more subfolders. As the source folder is a music collection, you should get 10 random albums (progress and result verbosly printed to the console in this case).

SelectEx PATH="C:\MyMusic'" RANDOM FOLDERS="subfldmax=0" ITEMCOUNT=10 ECHO RECURSE XLOG=all

Nice work again, tbone! Thanks for the new AutoSelect.Actions function. Works like a charm.

Following looks quite promising: SelectEx PATH="C:\MyMusic'" RANDOM FOLDERS="subfldmax=0" ITEMCOUNT=10 ECHO RECURSE XLOG=all, to play around with. Possibly you need to fine tune this part of the script. Because when it is applied to a root level, as M:, containing all the music categories in subfolders to choose from, the script seems to try to include stuff from the trash bin, which results in a script error message. As in this example:

Scanning and Prefiltering
[M:]..
[M:$RECYCLE.BIN]..
Error in line 403, Position 6
permission denied. (0x800a0046)

Thank you. It good to see there still some life here. There is so many option that it offer that I find too overwhelming, so I will stick with the default Button/Menu provided.

I do want to know something, what does the "Filter-dropdown" "Filterlist" do? It doesn't seem to do anything for me, do I have to modify it?

Hi dopo, seems I missed your post, sorry for that. Regarding your question, maybe you like to look in the link below.
The menu/dropdown described there is basically the same in SelectEx, maybe you just have no filters created yet?
"Select by Filter buttons" (["Select By Filter" menu button))

Hello! I'd like to have a new random option, but I'm quite unable to do it myself, so I'm here asking for an help.
Basically, what I need is a command that:

  1. Selects n random files in a folder, depending on the MB value I set.
  2. Copies this files in another folder I specify.
  3. Optionally, moves the original files in a subfolder of the first one (ie. called "Copied")

We could call it "Copy x MB of files to folder".

Is it possible? Thank you very much!

Try this after adjusting the folders at the top and the line starting with SelectEx in regard to MAXSIZETOTAL and ITEMCOUNT.

@set MoveFolder=D:\RNDTest
@set CopyFolder={sourcepath$}\Copied

Select ALLFILES 
SelectEx RANDOM FILES MAXSIZETOTAL=1mb ITEMCOUNT=100 DESELECTNOMATCH

CreateFolder {$CopyFolder} READAUTO=no NOSEL 
Copy TO {$CopyFolder}

CreateFolder {$MoveFolder} READAUTO=no NOSEL
Copy MOVE TO {$MoveFolder}

I think you also need to switch paths for the Move/CopyFolder and make sure to use DO v11 (your info says you are on v10?).

I need to update my profile. I have DO 11.17 x64.
:wink:

Thanks for the answer. I forgot to say I need to input the destination folder.
Basically, I have a big "pool" folder from which I need to extract about 1GB each time in different targets.

I saw some commands in SelectEx open a dialog and I wished it could be the same.

Eat this! o) Adjust paths and SelectEx options as needed, switch button to type "script function" as well.

@script jscript
function OnClick(data){
	var PoolFolder = "D:\\tmp\\2015_11_12_delme"; //DOpus.Dlg.Folder("Select Pool", "D:\\pool");
	var MoveFolder = DOpus.Dlg.Folder("Select Move-Target", "D:\\RNDTest");
	var CopyFolder = PoolFolder+"\\Copied";
	
	var cmd = data.func.command; tab.Vars.Set("SexRes") = "";
	cmd.RunCommand('SelectEx XLOG=all RANDOM FILES PATH="'+PoolFolder+'" MAXSIZETOTAL=1mb ITEMCOUNT=100 SETVAR="SexRes" ECHO');
	var strFiles = tab.Vars.Get("SexRes"); if (strFiles=="") return;
	var arrFiles = strFiles.split("\n"), cmd = DOpus.Create.Command();
	for(var i=0;i<arrFiles.length;i++) cmd.AddFile(arrFiles[i]);
	
	cmd.AddLine('CreateFolder "'+CopyFolder+'" READAUTO=no NOSEL');
	cmd.AddLine('Copy TO "'+CopyFolder+'"');
	cmd.AddLine('CreateFolder "'+MoveFolder+'" READAUTO=no NOSEL');
	cmd.AddLine('Copy MOVE TO "'+MoveFolder+'"');
	cmd.Run();
}

First of all, REALLY thank you and happy new year.
As I told you, this is all new to me, so I have a couple of questions.

  1. I understand I have to copy this into the .js script (I edited the paths, at least THAT I know how to do :slight_smile: ), but how can I add the command in the toolbar button?
  2. Is it right that the temp path has // instead of \ ?
    Thanks again!