… or at least not as I think it should work.
(() => {
const app = Application("DEVONthink");
const r = app.getRecordWithUuid('UUID-of-parent-group');
const group = app.createRecordWith({name: year,
"record type": "smart group",
"search group": r,
"search predicates": `name:~ 2026`},
{in: r});
}
})()
This is supposed to create a smart group as child of the group r selecting all records containing the current year in the name. It does not, however: I get something weird, without any search predicate at all and searching in the database.
I have to set the properties searchGroup and searchPredicates after creating the smart group. Providing them in createRecordWith doesn’t work. At all – not even when copying data from another smart group.

