How to specify the "SortBy" order for "Find QUERYENGINE everythingglobal"?

The default order is by EVERYTHING_SORT_NAME_ASCENDING,
there are 4 flags for everythingglobal: case, whole, regex, diacritics,
I can not find a argment to specify the "SortBy" order (such as EVERYTHING_SORT_DATE_MODIFIED_DESCENDING)

Help...

Find QUERYENGINE everythingglobal QUERY *.mp3
Set SORTBY=modified SORTREVERSE=Off

That only works for me if the results list is already showing. (Otherwise, I think the Set command is running on the old folder, not the results.)

If you always want this type of search results sorted by date, you can set that up by changing the Folder Type Formats / Search Results entry under Preferences / Folders / Folder Formats.

Folder Type Formats / Search Results was turned off in my config, but i have to run the commmand twice to sort by the modified column.

This is not what I want.
Think this command:

Find CLEAR QUERYENGINE=everythingglobal SHOWRESULTS=source,tab COLLNAME temp  QUERY dopus.exe

set everything_max_results to small number.

I want find three latest dopus.exe and put them into a temp collection.
I find no way to do this.

if using jscript like this:

var ev = DOpus.Create.EverythingInterface;
var result = ev.Query("dopus.exe", "", "f", 14, 3);

then how to put the result into a collection?

I think it is slower than using command directly "Find CLEAR QUERYENGINE=everythingglobal COLLNAME temp QUERY dopus.exe"

Take the list of file paths and add them to a Command object (usually via ClearFiles/AddFiles methods), then use the same object to run a command like this on those files:

Copy COPYTOCOLL=member TO="coll://My Collection"
	var collName = 'Everything/testA'
	cmd = DOpus.Create.Command;
	for (var i=0; i < searchResult.count; i++){	
		cmd.AddFile(searchResult(i).fullpath)
	}
	cmd.AddLine('dopusrt /col create "' + collName + '"');
	cmd.AddLine('Copy COPYTOCOLL=member TO="coll://' + collName + '"');
	cmd.AddLine('Go "coll://' + collName + '" newtab=findexisting');
	cmd.Run;

Is there more optimized code?

Since calling dopusrt is asynchronous, I'd try to either create the collection some other way (I did a quick search and could not find the way to do it), or start by calling dopusrt right from the start to minimize the chances the collection is not yet created when using Copy COPYTOCOLL.
Maybe @Leo has insight on wether this could be a real problem or not.

CreateFolder NAME="coll://My Collection"

or combine with Copy:

Copy CREATEFOLDER="coll://My Collection"
cmd.AddLine('Copy COPYTOCOLL=member CREATEFOLDER="coll://' + collName + '"');

The problem is :
if that collection already exists,we can not clear all files in it.
Is there any way without using dopusrt.exe?

You can delete the collection.

Examples here if you need them: