“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 dbconsistently 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:
osascriptvia 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 dbcan be set to a variable, it often fails when passed as a direct parameter to theatproperty ofmake. - Class Mismatch:
root of dbreports its class asparent, notgroup. Ifparentis an abstract class, it appears the AppleEvent bridge is rejecting it as a valid container formake new group. - Coercion Errors: Forcing
properties of rootto text results in an error:Can’t make {«class DTce»:...} into type text. - Path Persistence: Errors persist whether the database is referenced by
nameorid, thoughidreferences trigger-1728more frequently.
Questions
- Is
roota Record?: Is the object returned byroot of databasetechnically arecordobject, or a unique internal pointer that requires specialized handling in macOS 15/16? - Parent vs. Group: Why does
class of rootreturnparent? Shouldmake new groupbe targeting a different property to land a group at the top level? - CLI vs. GUI: Does
osascriptexecution via Terminal introduce a race condition or permission sandboxing issue that the internal Script Menu does not? - Reliable Alternatives: Are there JXA (JavaScript for Automation) snippets that handle the
rootobject more robustly than AppleScript’smakecommand?
Thank you, rXf