zotero-better-bibtex
zotero-better-bibtex copied to clipboard
No automatic exports from saved search
- [x] I have verified that I am on the latest release of BBT (https://github.com/retorquere/zotero-better-bibtex/releases/latest) and Zotero
- [x] I am posting a single question, bug or feature request
- [x] I have included a descriptive subject of the problem
- [x] I am available for follow-up questions and testing
Any plan for this to change? I was using it in a few places. Thanks.
I'd love to actually, but Zotero doesn't tell me that it's exporting saved searches, it just says "export these items" where "these items" happen to be the search result. For collections and libraries I'm actually getting the library/collection to be exported so these are easy to detect. I used to have an elaborate way to reconstruct that a search-export was taking place, but that involved some fairly invasive runtime changes to Zotero that I'm no longer comfortable making. If Zotero would mark the export so I could recognize it was a saved search, it would be easy to do.
Would it be possible just to do an export on a schedule?
It's not the auto-export that's the problem, it's detecting that the thing being exported is a saved search; technically, when you right-click on a collection and select "export", one of two things happen:
- for a library or a collection, Zotero hands its internal exporter the library or collection. I've patched the internal exporter to pick this up, I schedule the auto-exporter, done.
- for a saved search, zotero gathers the items being displayed, hands that list to the internal exporter, but my patch can now only see that Zotero told the internal exporter to "export these
n
references". I cannot see why thesen
references are being exported -- maybe you ctrl-clicked them together, maybe it was a saved search, but there's no (good) way for me to tell.
If Zotero would say "export these n
references, which are the result from saved-search X
", it'd be easy (not trivial, but easy enough) to add auto-export.
So I could pester them about that? :-)
You could, I could, but my schedule is hectic these days, so I prefer to currently limit my work to what I can do without having to coordinate, and there's still some gnarly bugs that need my attention. I could provide any required technical insights, but showing a user need would probably help, yes.
I've opened the discussion here.
Hello. I've opened a discussion on the zotero forum. See : https://forums.zotero.org/discussion/70534/auto-exporting-saved-searches
(Continued from https://github.com/retorquere/zotero-better-bibtex/discussions/2139#discussioncomment-2755517) So Zotero 4 (with Firefox) used to mark exports for saved searches, such that BBT 1.6.100 can distinguish between a saved search being exported or a manually selected list of items? And Zotero 5 & 6 no longer do so?
(Continued from #2139 (reply in thread)) So Zotero 4 (with Firefox) used to mark exports for saved searches, such that BBT 1.6.100 can distinguish between a saved search being exported or a manually selected list of items? And Zotero 5 & 6 no longer do so?
No, but it was easier for me to capture the action of the right-click on the saved export and smuggle it all the way to the export being started by tacking the info onto some data structures that were for Zotero internal use but which tolerated extra data being tacked on. It was always a fragile way of doing things, it just got so fragile I no longer felt I could support it.
Zotero however knows it's just handled a right-click on a saved search and that an export was started, so it could safely mark the export as "export these items, oh and should you care, these items were the result of saved-search X". The extra information wouldn't bother anyone not using it, but for BBT it would mean a safe way to capture these exports. Such tagging as "collection" or "library" is already done for those two types, but mostly as an artefact of how export was implemented.
Note that saved-search auto-export is always very expensive, because Zotero does not notify "this search now also yields this extra item" or "this item no longer matches that search". If you had a saved-search export, BBT would fire off the search(es) for any item that changed, see whether the search result included the changed item, and then kick off that export.... and come to think of it, I'm not sure that I cached what items were matched previously, so there's a good chance that "item no longer matches search" never updated the auto-export.
Thanks for that details. So for your own use case, you simply gave up all auto-exports of saved searches, and only export them manually when needed, by right clicking on the saved searches in Zotero to export them?
Correct. The explanation above was incorrect BTW -- I wasn't tacking it onto something that would tolerate it, I was replacing some internal data of Zotero in an incompatible way, which would break Zotero if it tried to access it, but because I knew the call chain precisely, and everything was synchronous, I was sort of sure I could change it back just in time before Zotero tried to use it. It was easily one of the more crazy monkey-patches BBT employed.
Z5 changed all that, and I could no longer realistically oversee all call chains. Something was bound to break sooner rather than later, in impossible to debug ways. If Z adds the information to the export context, it would not be too hard to add it back -- not trivial, so it would take some time, but feasible.