URL/UUID for database root?

Getting item links for documents, groups, and tags is straightforward, but I’m wondering if there’s a way to get a UUID for the root of a database?

The purpose of this would be to quickly navigate to a database root from outside of DTTG.

This will put the URL of a database on the clipboard

tell application id "DNtp"
	set theDatabase to the current database
	set the clipboard to "x-devonthink-item://" & ((uuid of theDatabase) as string)
end tell

[size=85]Note to scripting folk: databases themselves do not have the Reference URL property, which is why the script builds up the equivalent data element from scratch.[/size]

Fantastic, thanks Korm!

Hmmm, script works perfectly.
On the desktop the URL with the UUID takes me to the database without error, but on iOS it doesn’t take me to the correct database and displays an “Item not found” error in a hud.

Interesting. Perhaps not synced? Anyway, works over here on DTTG. (I’ve found that how well links work is frequently a mystery at the mercy of iOS.)

Hmmm no issues with sync, all up to date on both ends!
Indeed could just be some iOS fussiness. I’ll keep playing.