Behavior of modifiers in a script button's "Modifiers" tab?

Hi!

I'm trying to find out how the "Modifiers" tab for command buttons of the "Script Function" type works.

Looking through the docs (Advanced Command Editor, Script Functions, Command modifiers), I can't find anything talking specifically about how they work for JS script type buttons.

  • I assume evals are not happening per click unless @evalalwaysis on?
  • I hope anything dynamic happens before the script's OnClick is called?
  • Can modifiers be applied conditionally here?

To the last point:
Consider the following working Standard Function (Opus or external) example which copies either everything (default), or only files or folders on ctrl/shift, respectively

@keydown:ctrl
@filesonly
@keydown:shift
@dirsonly

@keydown:common

Copy TO ".\# target"

If I try to replicate the functionality of setting a different modifier based on @keydown states for a Script Function, it fails by always behaving like @filesonly was specified, no matter the keydown states:

function OnClick(clickData){
	DOpus.Output("Count: " + clickData.func.command.files.count);
	DOpus.Output(colToArray(clickData.func.command.files).join("\n")); // `Item`'s default return value of its path (string) is used
}

// Just a helper function; should not be relevant to this question
function colToArray(coll){
	if(!coll || typeof coll != "object")
		return [];
	try{
		var enumFields = new Enumerator(coll); // jshint ignore:line
		enumFields.moveFirst();
		var array = [];
		while (enumFields.atEnd() === false) {
			var i = enumFields.item();
			array.push(i);
			enumFields.moveNext();
		}
		return array;
	}
	catch(e){
		// log("Error trying to convert coll to array");
		// log(e);
	}
	return [];
}

Modifiers tab:

@keydown:ctrl
@filesonly
@keydown:shift
@dirsonly

For an example of

C:\tmp\Some folder
C:\tmp\Some file

being selected, this only ever outputs

C:\tmp\Some file

with the above modifiers.
Why is this?

Is there documentation on the Modifiers tab and how things here differ from the body of a "Standard Function (Opus or external)" button script?

I don't think you can have conditional modifiers like that. I'd be surprised if that works in a normal button, let alone a script one.

Your script code can skip items it doesn't want to handle without needing a modifier.

I edited the above to better highlight that it does work in "Standard Function (Opus or external)" mode:

Does your surprise mean that you think it shouldn't work (am I experiencing a weird coincidental quirk?) or simply that you weren't aware that it does?

Yeah, I know, of course I know... Just got excited to maybe have a new, convenient way to control the behavior outside of accounting for it in the script function itself.
In addition to general curiosity as to how things work with the Modifiers tab setup.

If you're saying point 3 is not supported, I'll take that as the answer.
If you have one for 1 and 2, I'd prefer your word over trial-and-erroring @modifier behavior myself, TBH :sweat_smile:

Most importantly though, I think it would be nice to give the Modifiers tab its own space in the docs.
I'm only guessing that it shares most of the modifier logic with DOpus script functions, sans the commands part, but maybe there's only a subset of modifiers that are supported? Maybe there is custom/different logic in some cases?
The above example points to something being different somewhere