Root of DB returning 'parent' class mismatch

“Can’t make group into type type” (-1700): Root of DB returning ‘parent’ class mismatch

Hi — I’m automating group creation in DEVONthink (specifically for my felixorg_lib database) via AppleScript and hit persistent errors. I suspect a DT AppleEvent/class mismatch in the current build and wanted to see if others have seen this or have a reliable JXA/AppleScript workaround.

Symptoms

  • Listing Failure: Trying to list children on a database raises: "Can't get every child of database id 2." (-1728).
  • Creation Failure: Creating a group at root of db consistently fails: "Can't make group into type type." (-1700).
  • Silent Failure: Using create record with {type:group} often returns success in the log, but the group never appears in the GUI.

Environment

  • macOS: Tahoe 26.3.1.
  • DEVONthink: Server 4.2.2.
  • Execution: osascript via Terminal and Script Editor.

Minimal Repro Scripts

1. Standard make command (Fails with -1700)

tell application "DEVONthink"
  set db to database "felixorg_lib"
  set r to root of db
  -- Error: Can't make group into type type
  set g to make new group with properties {name:"TEMP_TEST"} at r
end tell

2. Alternative create record (Silent Failure)

tell application "DEVONthink"
  set db to database "felixorg_lib"
  set r to root of db
  -- Reports success, but group is invisible in DT
  create record with {name:"Plato_Test_Group", type:group} in r
end tell

Key Diagnostics & Observations

  • The “Object Reference” Paradox: While root of db can be set to a variable, it often fails when passed as a direct parameter to the at property of make.
  • Class Mismatch: root of db reports its class as parent, not group. If parent is an abstract class, it appears the AppleEvent bridge is rejecting it as a valid container for make new group.
  • Coercion Errors: Forcing properties of root to text results in an error: Can’t make {«class DTce»:...} into type text.
  • Path Persistence: Errors persist whether the database is referenced by name or id, though id references trigger -1728 more frequently.

Questions

  1. Is root a Record?: Is the object returned by root of database technically a record object, or a unique internal pointer that requires specialized handling in macOS 15/16?
  2. Parent vs. Group: Why does class of root return parent? Should make new group be targeting a different property to land a group at the top level?
  3. CLI vs. GUI: Does osascript execution via Terminal introduce a race condition or permission sandboxing issue that the internal Script Menu does not?
  4. Reliable Alternatives: Are there JXA (JavaScript for Automation) snippets that handle the root object more robustly than AppleScript’s make command?

Thank you, rXf

  1. No. It is a parent.
  2. There’s already a create location command for creating groups. It follows a POSIX-style syntax.
  3. Why would you be using osascript on the commandline?
  4. You don’t use the make command.
tell application id "DNtp"
	set r to (root of (current database))
	create location "/this is in the root"
	create location "/this is also in the root" in (root of current database) -- (root of current database) is REDUNDANT here
	create record with {name:"This is from create record with", record type:group} in r -- (root of current database) -- This is doable but would be considered unusual.
end tell

JXA and AS rely on the same AppleEvents. It did not matter which one you use. And make plays no role in that.

Thank you – the script works now as intended.

You’re welcome.