Item.realpath.pathpart is undefined for library item

Sample library, test button and code as follows. Test output correctly returns the real full path including filename but the pathpart property is undefined.

image

testItem.realpath = C:\Users\admin\Videos\choices.mp4
testItem.realpath.pathpart = undefined

Realpath.dcf (1.3 KB)

function OnClick(clickData)
{
	// --------------------------------------------------------
	DOpus.ClearOutput();
	// --------------------------------------------------------
	var cmd = clickData.func.command;
	cmd.deselect = false; // Prevent automatic deselection
	// --------------------------------------------------------
	var files = clickData.func.sourcetab.files;
	if (files.count==0) return;
	var testItem = files(0);
	DOpus.Output("testItem.realpath = "+testItem.realpath);
	DOpus.Output("testItem.realpath.pathpart = "+testItem.realpath.pathpart);
	// --------------------------------------------------------
} 
2 Likes

That will work in the next beta.

There were some situations where item.realpath returned a path object, and others where it returned a simple string. It should always be a full path object now.

1 Like