Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open element in Zotero through citekey #769

Closed
houshuang opened this issue Nov 8, 2017 · 27 comments
Closed

Open element in Zotero through citekey #769

houshuang opened this issue Nov 8, 2017 · 27 comments

Comments

@houshuang
Copy link

Amazing plugin. I am wondering if there is any way of opening an item in Zotero through a URL if you only new the citekey. Let's say I have an item in Zotero with the citekey johnson2000molecules... Would it be possible to do something like zotero://bbt:johsnon2000molecules etc, and have Zotero open (or activate) with the right publication selected?

Thank you!

@blip-bloop
Copy link
Collaborator

🤖 this is your friendly neighborhood build bot announcing test build 4710 ("add item keys").

@retorquere
Copy link
Owner

I've hooked into the existing select mechanism; zotero://select/items/bbt:<citekey> (user library) or zotero://select/items/bbt:{<group id>}<citekey> should work in 4710 (<group id> of 0 is the same as user library) but I haven't tested it since I have no idea how it is actually used.

@dbobak
Copy link

dbobak commented Nov 13, 2017

Does not work. At all - Zotero partially hangs at start with message "Better BibTeX: Starting key manager...". "Partially" means, that menus in Zotero works, but the content of the window is inactive.

Error report ID: AZRRUZK5

Tested with BBT 4710; with later (4719, 4721) the error does not appear but also the link does not work.

@blip-bloop
Copy link
Collaborator

🤖 this is your friendly neighborhood build bot announcing test build 4725 ("DB upgrade").

@dbobak
Copy link

dbobak commented Nov 13, 2017

4725: links doesn't work, neither zotero://select/items/bbt:Adams1999Lower nor zotero://select/items/bbt:{0}Adams1999Lower

@retorquere
Copy link
Owner

How do you test this? I have no idea how these work.

@dbobak
Copy link

dbobak commented Nov 13, 2017

  1. Just paste the link to Chrome or Firefox. Zotero window gets focus, but the cursor do not follow the desired position.
  2. Create link in Atom and click it. Result is the same as above.

PS. Standard link in the form of zotero://select/items/0_IPSS4ETH works with no problem.

retorquere added a commit that referenced this issue Nov 13, 2017
@retorquere
Copy link
Owner

I've tried this; in chrome, it just googles that link, and in zotero, it tries to open Zotero a second time (which fails, because the profile is locked by the running Zotero).

I can try at my work desktop which runs Linux; right here I only have a macbook.

4727 should drop here in a bit and that will have more debug logging; it'd be helpful to get a new debug log after accessing such a link.

@blip-bloop
Copy link
Collaborator

🤖 this is your friendly neighborhood build bot announcing test build 4727 ("debugging for #769").

@dbobak
Copy link

dbobak commented Nov 14, 2017

When you paste the link into the address bar in Chrome (but do not press enter then) you'll see pull-down menu with options: open link in Chrome or search in Google. Choose the first :)

The build 4727 is working as it's expected: Zotero windows gets focus and the cursor follows to the reference. But the only in the version without group ID, ie:
zotero://select/items/bbt:Adams1999Lower - works
zotero://select/items/bbt:{0}Adams1999Lower - does not work.

Report ID: 882ZXTWH

@retorquere
Copy link
Owner

Well at least the behavior is consistent now -- Chrome also wants to open a 2nd Zotero instance, which is not allowed because profile locked, yada yada 😆. Don't know how I've screwed up my machine (which I likely did), but this POS is due for a replacement anyhow. Just a few months more. The log had good information though -- 4736 will drop in a few minutes with a fix.

@blip-bloop
Copy link
Collaborator

🤖 this is your friendly neighborhood build bot announcing test build 4736 ("IDs are uri-encoded").

@retorquere
Copy link
Owner

4736 should fix it.

@dbobak
Copy link

dbobak commented Nov 14, 2017

Sorry, but still no banana with 4736.
Link with the group ID (zotero://select/items/bbt:{0}Adams1999Lower) still does not work

Report ID: 8TX6JDKR

@blip-bloop
Copy link
Collaborator

🤖 this is your friendly neighborhood build bot announcing test build 4745 ("decodeURICompenent does not work?").

@retorquere
Copy link
Owner

Still the same error. 4745 adds more logging.

Sorry to have to lean on you guys for testing, but I can't trigger it here.

@dbobak
Copy link

dbobak commented Nov 14, 2017

You're doing a great piece of job with BBT, I'm just glad to help :)

Report ID for 4745: DM5UX6BX

@blip-bloop
Copy link
Collaborator

🤖 this is your friendly neighborhood build bot announcing test build 4747 ("return libraryID, not unparsed lib").

@retorquere
Copy link
Owner

4747 should do the trick (but then I claimed that before)

@dbobak
Copy link

dbobak commented Nov 14, 2017

Indeed. 4747 works :) Thanks!

@mijalche
Copy link

very interesting feature!
I have a question this functions very well for My Library, however it does not function for the Group Libraries.
I assume is connected with the Group ID. Where I can find the Group ID?

@retorquere
Copy link
Owner

I don't know - in the same way you'd get them for the regular selects I guess. I hijack the mechanism that supports /select/items/library_internalKey. How people used to get those I don't know.

@dbobak
Copy link

dbobak commented Nov 15, 2017

I don't use groups, so I haven't tested it before. But:

  1. I'm checking the group ID in the Zotero website. And got, for example: 290013.
  2. Trying to get link to the item: zotero://select/items/bbt:{290013}NerudaNerudova2013MiddleUpper
  3. Link doesn't work.

I'm not sure if it is a problem of BBT or wrong group ID; how to check the group ID is described here, but it seems to be deprecated.

Anyway, the error report ID is: 6SRKPGD9

@retorquere
Copy link
Owner

The group ID is a local thing I think.

The debug report won't help -- the feature works as intended (select by group ID + citekey), but how you discover the group ID is outside BBTs scope. The "Get BibTeX URL" will likely have the lib id, but I can't test where I am now. See also https://forums.zotero.org/discussion/24241/linking-to-zotero-items-via-zotero-select and http://protips.maxmasnick.com/zotero-quickly-get-links-to-library-items-using-zotero-slash-slash-url-scheme-links .

@dbobak
Copy link

dbobak commented Nov 15, 2017

Yes! The "BibLaTeX URL" command gives the correct library ID and the links are ok now.

@mijalche
Copy link

Excellent! Links are working for me, also.
For the others: you get the BibLaTeX URL by right click on the group library name. It is the number after .../better-bibtex/library?/NUMBER

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants