createRecordWith problem (ScriptingBridge)

Hey,

I cannot figure out how to create a new record using the Objective-C endpoint:

In the generated DEVONthink3.h (sdp), the method on the DEVONthink3Record interface looks like this:


- (DEVONthink3Record *) createRecordWithIn:(DEVONthink3Record *)in_;  // Create a new record.

When converted to Swift protocol definitions, the method looks like this:

@objc optional func createRecordWithIn(_ in_: DEVONthink3Record!) -> DEVONthink3Record // Create a new record.

That doesn’t quite make sense. All it would accept like this is the destination. I would expect something like this:

@objc optional func createRecordWith(_ x: DEVONthink3Record!, in in_: DEVONthink3Record!) -> DEVONthink3Record
@objc optional func createRecordWith(_ x: Any, in in_: DEVONthink3Record!) -> DEVONthink3Record
@objc optional func createRecordWith(_ x: [String:Any], in in_: DEVONthink3Record!) -> DEVONthink3Record
@objc optional func createRecord(with x: DEVONthink3Record!, in in_: DEVONthink3Record!) -> DEVONthink3Record
@objc optional func createRecord(_ with: DEVONthink3Record!, in in_: DEVONthink3Record!) -> DEVONthink3Record

Any ideas on how to make this work? Thanks! :pray:

I have no experience with that. Nor did I find anything useful on the net except for this rather discouraging thread:

I’d rather use JavaScript and call ObjC methods from there. The same approach is viable for AppleScript. @pete31 posted some examples here already. Searching for “NSString” and “tell” might reveal those.

Ah, the scripting bridge works perfectly fine otherwise, that is not the problem. It’s just this one out of place method I encountered :man_shrugging: