Command: SelectRandom (randomly select files/folders)

If you just want to select all files, Select ALLFILES is built-in and all you need; you don't need a script for that.

Thanks for your fast response, Leo. No, I want to select random files. It seems like it is possible to select only files and not folders, since the author wrote regarding settings "FILES - select files only (default is files or folders)"

In that case, use the SelectRandom command the script adds, and just add the FILES argument to the command.

There are multiple examples of how to do that in the root post. For example:

Select 50% of files:

SelectRandom FILES ITEMCOUNTPERC=50

Should I add the FILES argument in this line here?
commands : GetParameter(data, "COMMANDS", null, "ScrollSelectionIntoView"),

I use ScrollSelectionIntoView option, but where should the FILES argument be?

It looks like you’re editing script code of something. But I am not sure. It’s wrong, whatever it is.

You should just be using the SelectRandom command like a normal command, outside of any script. (The command is made by the script this thread is about, but you don’t write script code to use it.)

The correct way to use the command will look like all the examples in the root post.

1 Like

Quoting from the top post:

SelectEx has a downloadable menu button, which contains 2-3 examples on how to select random files (of any or special kind).

1 Like

Is it possible to not select the ones that are already moved to the file collection? It's so annoying to get the error message
изображение

First, this command is not maintained anymore, use SelectEx, as posted several times now.
Whatever you do with SelectRandom, it does not copy files, so please check your button and maybe fix the call to the Copy command. To do this, hit F1 and lookup the parameters for the internal Copy command in the reference section of the help. There probably is some kind of "QUIET", "REPLACE" etc. switch you can add to the button code to prevent the error message.

The SelectRandom works fine as well. The SelectEx has a lot of features that I don't need. But thank you for the advises to use these commands. Copy WHENEXISTS=skip helped me. The only remaining problem is that I drag the selected files and when I randomly select the files again and again I drag duplicate files sometimes in a folder.

I can't see that SelectEx can solve this issue. Can I select only the files that are not in the collection?
Maybe I do something wrrong with SelectEx? I also hoped that the command below would help me, but no

изображение

Maybe hiding all files already in the collection before doing the random selection would help.
You can do this by selecting all files in the collection, then use Select SOURCETODEST, switch to your random files and use SelectEx's "Hide selected..", then start your random selection on files which are definitely not in the collection. It's just a guess.. maybe worth a try.

excellent