Closed FeralFlora closed 8 months ago
So, one annoying thing about zotero/BBT is that you have to explicitly specify which library you want to import from. runImport
actually supports a 3rd parameter which is the library id, which is 1
by default (My Library). The function signature looks like this: runImport(name: string, citekey: string, library: number = 1)
. I'll have to think on this to see if there's a user friendly way of selecting a library
So, one annoying thing about zotero/BBT is that you have to explicitly specify which library you want to import from.
runImport
actually supports a 3rd parameter which is the library id, which is1
by default (My Library). The function signature looks like this:runImport(name: string, citekey: string, library: number = 1)
. I'll have to think on this to see if there's a user friendly way of selecting a library
Hey @mgmeyers, thanks for the answer! That does clear up some things, but it's still unclear to me if there's a reliable way for users to select a particular group library. Like, are the numbers in the same order as in the Zotero UI? Actually, I did some tests in the Zotero console, and it appears that the numbers are in the same order as the order in the Zotero UI.
You can check it using: Zotero.Libraries.getName(NUMBER)
, and inputting a number. 1 is of course "My Library", 2 is the first one below My Library and so on.
While Zotero Integration can import from group libraries, it seems that this capability doesn't extend to group libraries for some reason.
When I run the runImport command from the console like so:
app.plugins.getPlugin('obsidian-zotero-desktop-connector').runImport('Literature note', "@Bell.etal2019SpatialHabitatVariation")
I get the following errors:
The citekey was copied from Zotero's item pane of an item in a group library, so that shouldn't be the issue.
Demo: Item imported via command palette, but fails via runImport
https://github.com/mgmeyers/obsidian-zotero-integration/assets/33608083/f133cdca-62fb-4907-88ff-a33263cdb77b