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?