In right-click menus, with @keydown:shift
to run user command, the code item.filegroup
can not work in the script of user customized command.
Please show some sample code.
Here is my command. Pack.dcf (6.5 KB)
When group is open, it will go wrong in file type context menus which works well in DO tool bars.
It seems to work fine here:
@script jscript
function OnClick(clickData)
{
DOpus.ClearOutput();
for (var eSel = new Enumerator(clickData.func.sourcetab.selected); !eSel.atEnd(); eSel.moveNext())
{
var item = eSel.item();
var group = item.filegroup;
DOpus.Output(item + ' group is "' + group + '"');
}
}
Ah OK, this doesn't work, if you get the file list from the command object instead of the tab object:
@script jscript
function OnClick(clickData)
{
DOpus.ClearOutput();
for (var eSel = new Enumerator(clickData.func.command.files); !eSel.atEnd(); eSel.moveNext())
{
var item = eSel.item();
var group = item.filegroup;
DOpus.Output(item + ' group is "' + group + '"');
}
}
Not sure why yet. We'll look into it. But you can use the tab's selected files object as a workaround.
This has been fixed for the next beta.
Thanks for reporting it!
I've see it fixed in the new beta just now. Thanks for your great work.