Sample output from the button code snippet appended below:
f = C:\Users\admin\Downloads\Beach and Sand.zip
md = doc, grps = Archives
f.metadata.tags = just;testing
This is consistent for all .zip files that I have tried. I would expect metadata to be "none" rather than "doc".
function OnClick(clickData)
{
if (clickData.func.sourcetab.selected_files.count==0) return;
DOpus.ClearOutput();
var f = clickData.func.sourcetab.selected_files(0);
DOpus.output("f = "+f);
var md = f.metadata;
if (String(md)=="none") {
DOpus.output("md = "+md);
return;
}
var grps;
for (var i = 0; i < f.groups.count; i++) grps = (i==0) ? f.groups(i) : grps+", "+f.groups(i);
DOpus.output("md = "+md+", grps = "+grps);
DOpus.output("f.metadata.tags = "+stringTags(f.metadata.tags));
}
function stringTags(v)
{
var str = "";
if (typeof v!="object") return v;
if (typeof v.count!="number") return v;
for (var i = 0; i < v.count; i++) str = (i>0) ? str+";"+v(i) : v(i);
return str;
}