How to retrieve item root by script

Is there an easy way to retrieve item root (c:, lib://,coll://) by script please

here
https://www.gpsoft.com.au/help/opus12/index.html#!Documents/Scripting/Path.htm

item.path.root

This return True or False, I need (c:, lib://,coll://) by script please

path.Set "C:\blah\blah"   ' path now contains "C:\blah\blah"
path.Root                 ' path now contains "C:\"

According to the help Root will return bool. The drive could be extracted from item.path. Retrieving File Collections from item might be difficult.

Sorry but I failed.
I want to retreive root, folder only and date.
Here my script...

Function OnClick(ByRef clickData)
 Set tab = clickData.func.sourcetab         
 DOpus.Output "-----------------------------------------------------------"
 DOpus.Output "Source - Path: " & tab.path
 DOpus.Output "Source - Real Path: " & DOpus.FSUtil.Resolve(tab.path)
 DOpus.Output "<font color="#ff0000">Source - Root: " & tab.path.root & "</font>"
 DOpus.Output "<font color="#ff0000">Source - Folder: " & tab.path.filepart & "</font>"                  
 DOpus.Output "<font color="#ff0000">Source - Modify: " & DOpus.FSUtil.GetItem(tab.path).modify & "</font>"
 DOpus.Output "-----------------------------------------------------------"       
End Function

You both stopped reading too soon. :slight_smile:

As well as returning a bool, it also changes the path. The bool tells you if the path was already at the root level and didn't need to change.

qiuqiu's link and Jon's code above are correct and what you need.

In my case it wasn't a lack of reading, more a lack of understanding :wink:

Thanks for the clarification!