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

Select item link works inconsistently #207

Open
cjpoor opened this issue Oct 25, 2021 · 7 comments
Open

Select item link works inconsistently #207

cjpoor opened this issue Oct 25, 2021 · 7 comments

Comments

@cjpoor
Copy link

cjpoor commented Oct 25, 2021

The "select items link" function of Zutilo provides for linking to the pdf in Zotero.

In Zim-wiki on linux when you paste the link such as zotero://select/library/items/URRRWW22 into a page it can be clicked and will bring up Zotero and highlight the pdf.
However, on my linux setup, Zim seems to be the only app that achieves this.

The link works somewhat more consistently on Mac OS X (it works on Smultron and the apple Notes and Pages apps but not on apple TextEdit) and some discussions on the web suggest that such links require linux to be set up to enable them when installing. However it seems that Zim does not require any such forethought.

Could you tell me if there is some way I could get the select item links to work more consistently?

Linux Mint Cinnamon 20.2
Linux kernel: 5.4.0-66-generic
Zotero version: 5.0.97-beta.51+6206209ed
Zutilo: 3.10.0

Mac OS version: 10.13.6
Zotero: 5.0.96.3
Zutilo: 3.10.0

@qqobb
Copy link
Collaborator

qqobb commented Oct 26, 2021

I never tested zotero://select links on Linux. But since Linux Mint is Debian-based, I would recommend trying Emiliano's zotero-deb package. It should take care of the zotero scheme.

If you're not yet running the zotero-deb package and want to try it, uninstall the Zotero beta and then try to reinstall it through:

wget -qO- https://github.com/retorquere/zotero-deb/releases/download/apt-get/install.sh | sudo bash
sudo apt update
sudo apt install zotero-beta

For more technical details, see if this issue is of help: zotero/zotero-standalone-build#81.

There's also an older Zutilo issue (#47), but some of the information there might be outdated.

@cjpoor
Copy link
Author

cjpoor commented Oct 27, 2021

I tried the deb from Emiliano. If I paste the link into Firefox url bar and hit enter it will open Zotero but does not highlight the item.
The link does not work in other applications.

The interesting thing is that the link works with Zim-wiki. The link is immediately formatted as a link and clicking it opens Zotero and highlights the item.

The links you provided are about setting the zotero.desktop and xdg-open. As far as I can tell these are set correctly on my system. I assume Zim is making use of these.

There is some information here that might be of use:

Yes, zotero://select/items/0_82UIB2W6 is an old-style URL that shouldn't be used anymore. The new format would be as adamsmith says.

    zotero://select/groups/487712/items/6KQ4G4P6
    Where 487712 is the same library ID as used by the web API

(To avoid confusion, technically this is the "group id". libraryID is a different internal thing.) ```

@wshanks
Copy link
Owner

wshanks commented Oct 27, 2021

I use Zotero on Linux but I don't use select links regularly. I tried just now and saw the same behavior for Firefox (brings Zotero into focus but does not select a new item). Have you tried the things suggested in zotero/zotero-standalone-build#81 and the blog post linked at the bottom (the xdg-mime and update-mime-database, commands)?

@wshanks
Copy link
Owner

wshanks commented Oct 27, 2021

I played around with things and got select links working properly on my system. For the installation I started with, I had to make two changes to the .desktop file. One was to add the right MimeType line:

MimeType=x-scheme-handler/zotero;

The other was to add the -url flag in the Exec line (here is the example for the blog post):

Exec=bash -c "~/opt/Zotero_linux-x86_64/zotero -url %U"

For the way I had installed Zotero, the -url %U part was missing (I used the flatpak from flathub; there is an open PR to fix this issue for the flatpak).

After I fixed both of those entries, entering select links in Firefox selected the right entry in Zotero.

I didn't look into what is in the zotero-deb .desktop file, and I am not sure if the way you were installing Zotero originally involved installing a .desktop file. The blog post describes some of setting up a .desktop file. Let us know if you have any trouble with getting that set up right for the way you want to install Zotero.

What I don't understand is how Zim could select the right item already.

@cjpoor
Copy link
Author

cjpoor commented Oct 27, 2021

Thank for your reply.
I have those lines in zotero.desktop
I think most apps just don't recognize the select item link as a link but Zim does. Just paste the select item link and it can be clicked to show the item in Zotero.
In most other apps the link has to be explicitly made by selecting some text and inserting the select item link as a hyperlink to a file.
I can do this in Zettlr and LibreOffice Writer so mystery solved.
Sorry if this was a bit of a wild goose chase.

@qqobb
Copy link
Collaborator

qqobb commented Oct 27, 2021

I think most apps just don't recognize the select item link as a link but Zim does.

Yes, I guess you also need to tell the apps what valid links look like. That's the same for many Windows apps. Either Zim has all url:// schemes enabled by default or they explicitly added the Zotero scheme. Enabling all schemes by default might have security implications, so it's probably not a good idea.

@cjpoor
Copy link
Author

cjpoor commented Oct 27, 2021

Ah right. Thanks for the heads up.
I think the function is provided by the Zotero plug-in for Zim:
https://github.com/shivams/zim-zotero-plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants