Add local (linked) attachment via command-line or URL?
Hi, is there any way (in Zotero 7) to add a *linked* attachment programmatically, i.e. without using drag-and-drop? Command-line, URL, API, third-party tool, anything? Thanks.
linkFromFile
) for a hackier option. A future version of Zotero will offer a localhost API similar to the web API that could enable this sort of thing.const fileInfo = await Zotero.Attachments.linkFromFile({file: "..."});
await Zotero.RecognizeDocument.autoRecognizeItems([fileInfo]);
return fileInfo;
And the debug bridge install/setup instructions are here: https://github.com/retorquere/zotero-better-bibtex/blob/master/test/fixtures/debug-bridge/README.md
But you don't need the VSCode parts, if all you want to do is run some code remotely:
curl -s -H "Authorization: Bearer TOKEN-GOES-HERE" -H "Content-Type: application/javascript" -X POST --data-binary @exec.js http://127.0.0.1:23119/debug-bridge/execute
(where exec.js contains the javascript to run).