Hi,
I’m trying to export some specific properties (e.g. UUID together with name) for all (group) entries within a database. I’ve accomplished to do so for all root entries by
const dT = Application('DEVONthink 3');
dT.includeStandardAdditions = true;
const dbs = dT.databases();
for (const db of dbs) {
var names = db.records.name();
var uuid = db.records.uuid();
}
I also did manage to extend this approach recursively by repeating for all child entries:
...
for (var i = 0; i < db.records.length; i++)
someFunction(db.records[i].children);
...
where in someFunction
above steps are repeated and the function recursively calls itself. This exhibits however very poor performance.
My next idea was to get an array of all entries using the search function by
var list = dT.search("kind:group", {in: db.root()});
for which I could iterate through by
for (var i = 0; i < db.records.length; i++)
console.log(list[I].name());
but was unable to apply .name() at once, i.e.
list.name()
It appears that list
is of type object, while db.records
is of type function. I’m note sure what I’m doing wrong here - help would be greatly appreciated.
Also, I was unable to find any structured documentation for DevonThink and JXA (available functions and objects…) - does something like that exist?
Thanks!