I'm trying to integrate Bookends and DEVONthink using Javascript for Automation. I've managed to convert the item fields in BE to custom metadata in DT, but I'm struggling with getting a reference in a specific format, which I want to use for renaming the file in DT.
This little script does give me the default reference format, but I don't know how to specify a format within the `.format()` method. Unfortunately the details and examples in the Scripting Dictionary are all AppleScript-specific.
I don't have any specific knowledge of how to use JS here, hopefully someone else does. But have you tried the format name? -- let shortRef = item.format('Nature.fmt'); (or maybe "Nature.fmt")?
format PublicationItem or list of PublicationItem : The publication item(s) that will be formatted.
[using: text] : The reference format to use. If no format name is supplied, the default format specified in Bookends will be used. May be any format name supported by the Bookends Formats Manager, including tagged formats such as 'BibTeX', 'EndNote XML' or 'RIS'.
[as: "plain text"/"RTF"/"BibTeX"/"HTML"] : The file format to use. Defaults to 'plain text'.
→ text : The formatted reference(s). If multiple publication items are given, the returned references will be separated by a Return character.