mergeRecords
is not defined.
I compared the sdef
of DT (which I must have somehow generated using a tool, don’t remember how) to that of GraphicConverter. In the case of DT, the type
of the parameter is simply list
, whereas GC uses type="integer" list="yes"
. I don’t know if the difference matters or if it’s only the result of the automatic sdef generation.
Also, DT has obviously no problem at all to return a list of records from a method call (cf. classify
, selectedRecords
etc.). Which makes me wonder why it wouldn’t work with a list as input parameter.
@cgrunenberg: It is not about the parameter type “record”. See the following script using cells
and a sheet:
(() => {
const appDT = Application("DEVONthink 3");
const rec = appDT.createRecordWith({type: "sheet", columns:['A','B','C'],
'name': "newSheet"});
appDT.addRow(rec,{cells: ['1', '2','3']});
})();
The AppleEvents related to that:
app = Application("DEVONthink 3")
app.createRecordWith({"type":"sheet", "columns":["A", "B", "C"], "name":"newSheet"})
app.addRow(app.databases.byId(1).contents.byId(676287), {cells:[]})
As you can clearly see, the columns
parameter in the call to createRecord
is passed correctly (and also the parameter name is quoted!), whereas in the call to addRow
, the cells
parameter is suddenly empty, and it is not quoted.
I’m aware that JXA is messy and buggy, but is it really that buggy that it sends empty arrays only in some cases? I know, in the first case you pass in a record
(in the AS sense, not in DT’s sense), in the second one it is a named parameter. But from the JXA point of view, there’s no frigging difference at all: Both times, I pass in an object whose property names are just the names used in DT’s API.
Unrelated: What exactly would be the “specifier” to pass in as the first parameter to addRow
? I know that the record
returned by createRecordWith
does not work, but what does work? Didn’t even see an AppleScript example in the forum.