chrisgrieser / alfred-bibtex-citation-picker

Citation picker & lightweight reference manager for BibTeX files, via Alfred.
MIT License
137 stars 8 forks source link

Feature Request: Open-Open in Zotero #44

Closed kzssc closed 4 months ago

kzssc commented 4 months ago

Feature Requested

Current behaviour with "Open in Zotero" (triggered by shift when an entry is selected) is that it locates the entry within zotero then highlights it.

(One issue (not of the plugin, I think) here is that it does not work when Zotero is closed. When this is executed w/ Zotero closed, Zotero merely launches without finding/highlighting the entry. One needs to execute the execute command again to trigger the highlight from within Zotero.)

I propose a feature that actually opens the entry/file in zotero, in addition to locating this entry. Optionally and better: if the opening can be done external to zotero. (e.g. an external PDF viewer.)

The reason to this: open-in-zotero could take some time for Zotero, althought it does work.

Relevant Screenshot

No response

Checklist

chrisgrieser commented 4 months ago

Makes sense. However, I personally do not use Zotero, so I am not really familiar with the internals of how it works.

Currently this workflow opens the entry by calling the URI scheme zotero://select/items/bbt:{CITEKEY}. Do you (or anyone else) know of a URI scheme that does open the file like you described? Something like that would be required to be able to implement such a feature.

kzssc commented 4 months ago

Makes sense. However, I personally do not use Zotero, so I am not really familiar with the internals of how it works.

Currently this workflow opens the entry by calling the URI scheme zotero://select/items/bbt:{CITEKEY}. Do you (or anyone else) know of a URI scheme that does open the file like you described? Something like that would be required to be able to implement such a feature.

Thanks for the immediate reply, Chris.

Personally i don't know of anything/anyone that has a better way. (I vaguely remember this and the fork can do this but it generates a new temp file etc... i think it's too little to gain for a massive effort and trouble, so no.)

Nonetheless, as the .bib contains attachment directory, so possibly, a trigger might point at that?

chrisgrieser commented 4 months ago

could you share one or two example entries that have such a link to an attachment?

kzssc commented 4 months ago

sure, here! https://transfer.archivete.am/SaIWC/2%20Lottery.bib

chrisgrieser commented 4 months ago

okay, added the ability to open attachment files directly via ctrl+alt+cmd+return (sorry, there aren't enough modifiers left). Attachment files are files that have the key "file" or "attachment" in the BibTeX entry.

The Alfred gallery will auto-update within ~2-3 days, or you can simply download the new version directly: https://github.com/chrisgrieser/alfred-bibtex-citation-picker/releases/download/11.14.0/alfred-bibtex-citation-picker.alfredworkflow

daaaaaaaaaniel commented 4 months ago

It's not working for me. I set my PDF folder to the location where Zotero stores PDF ~/Zotero/storage/ but alas. I get the disappointed sound when I try to open the file in Zotero. The zotero://select/items/ version succeeds by holding shift, but when I add the extra modifiers to open the PDF, nothing.

Additionally, Zotero allows for multiple PDFs to be attached to the same bibliographic entry. For instance, sometimes I'll have separate PDFs for each chapter under the same book entry. So it would be great if there was a way of offering something like a "menu" where I could choose which attachment I wanted to open from the particular bibliographic entry that I've already called up. Like, if instead of just choosing the first one on the list after the user holds the right modifiers and hits return, it could display a menu with a list of possible attachments to open in cases where there are more than one available.

chrisgrieser commented 4 months ago

@daaaaaaaaaniel The current implementation is based on how the entries from kzssc look like. Likely, your entries are formatted differently.

Could you share an example of how your entries look like?

kzssc commented 2 months ago

Makes sense. However, I personally do not use Zotero, so I am not really familiar with the internals of how it works.

Currently this workflow opens the entry by calling the URI scheme zotero://select/items/bbt:{CITEKEY}. Do you (or anyone else) know of a URI scheme that does open the file like you described? Something like that would be required to be able to implement such a feature.

from https://github.com/giovannicoppola/zothero/issues/30 and https://forums.zotero.org/discussion/90858/pdf-reader-and-zotero-open-pdf-links it seem that with "zotero: //open-pdf" instead of the current "zotero://select" we can open the pdf in zotero (?)

chrisgrieser commented 2 months ago

from giovannicoppola/zothero#30 and https://forums.zotero.org/discussion/90858/pdf-reader-and-zotero-open-pdf-links it seem that with "zotero: //open-pdf" instead of the current "zotero://select" we can open the pdf in zotero (?)

if it is about opening attachments/PDFs, the current approach should already work, and has also the benefit for working for people not using Zotero. So I don't see the benefit of switching to zotero: //open-pdf, or am I missing something?

Otherwise, zotero://select is for revealing the entry in Zotero, which, to my knowledge, also works.

If you have a different feature suggestions, it's probably better to open a new FR where you outline what exactly you are thinking of?