The fsu.GetItem()
method seems to fail to create the item.filegroup
property. Or is my script wrong?
Button as XML
<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" textcol="none">
<label>GetItem Demo</label>
<icon1>#newcommand</icon1>
<function type="script">
<instruction>@script JScript</instruction>
<instruction>function OnClick(clickData) {</instruction>
<instruction> var cmd = clickData.func.command;</instruction>
<instruction> var tab = clickData.func.sourcetab;</instruction>
<instruction> var fsu = DOpus.FSUtil();</instruction>
<instruction> cmd.deselect = false;</instruction>
<instruction />
<instruction> var item = tab.selected_files(0);</instruction>
<instruction />
<instruction> DOpus.Output('item: ' + item);</instruction>
<instruction> DOpus.Output('item.filegroup: ' + item.filegroup);</instruction>
<instruction />
<instruction> var newItem = fsu.GetItem(fsu.Resolve(item));</instruction>
<instruction />
<instruction> DOpus.Output('newItem: ' + newItem);</instruction>
<instruction> DOpus.Output('newItem.filegroup: ' + newItem.filegroup);</instruction>
<instruction>}</instruction>
</function>
</button>