Properties Set Label in a JsScript doesn't apply the label in the file display

I made a JScript for a new command related to folders (contextual menu) to be able to assign different labels to the files of the selected folder.
Instead of putting the label on the files in the source display, only the folder is tagged (in the folder tree display).
Hereafter a simplified version of the JScript:

function OnClick(clickData)
{
	DOpus.ClearOutput();
	// --------------------------------------------------------
	var cmd = clickData.func.command;
	cmd.deselect=true
	DOpus.Output("Selected items in " + clickData.func.sourcetab.path + ":");

	cmd.RunCommand("Set FOCUS=source")
	DOpus.delay(200)
	cmd.RunCommand("Select FROMSCRIPT FIRST")
	DOpus.delay(1000)
	
	for (var eSel = new Enumerator(clickData.func.sourcetab.files); !eSel.atEnd(); eSel.moveNext())
	{
		if (eSel.item().is_dir)
		{
			DOpus.Output("  (d) " + eSel.item().RealPath);
		}
		else
		{
			DOpus.Output("  (f) " + eSel.item().RealPath);
			cmd.RunCommand("Select FROMSCRIPT NEXT")
			DOpus.delay(1000)
			cmd.RunCommand("Properties NOFROMFOCUS SETLABEL=Vert SETLABELTOGGLE")
			DOpus.delay(1000)
		}
	}
}

Note that the selection of each file works but the tagging ("Vert" means Green) is always done on the folder.
Why the files selected in the source display are not used for the tagging? I understood from the documentation that "NOFROMFOCUS " in the Properties command should force the command to operate on the source file display?

The command object has properties for which files/folders it runs the command over. By default it is the ones that are selected when the script begins.

If you want to change the files/folders a command uses, the command object has methods for that.

As a general rule, buttons/scripts should only change what's visibly selected if their purpose is to select things. There are more direct ways to specify what a command should run on when you need to do that.

So you want to right-click a folder, and then use your command, so you can apply labels to its content based on certain rules?

FWIW your example script is not doing that, it looks like it was vibe-coded or something.
It shouldn't even be doing what you're telling us it does.