Jump to content

ZotHero — Generate Zotero citations in Alfred


Recommended Posts

For those who are having trouble with this workflow, if you are willing to use a BibTeX intermediate (which is necessary for many workflows), This is a superb alternative with the developer active and working on this:

 

 

It functions really well across many different reference managers (I use Bookends, will work with Zotero if you use BetterBibTeX), and is very fast for search and insert when writing using markdown or LaTeX...

Edited by iandol
Link to comment

@iandol - thanks for drawing attention to that workflow. A quick tinker with it wasn't working for me (I don't actively use Bibtex, even though I've installed the Zotero/Bibtex plugin, so even configuring the workflow to point to my base Zotero directory wasn't finding my library), but I'll definitely keep an eye on it.

 

On the other hand, this Zotero workflow has started working again, after i changed the Zotero export type back to BetterBibText (I had changed it to a particular style when the workflow stopped working, but changing it back to BBT seems to have resolved the error I was seeing).

 

 

Link to comment
On 7/8/2022 at 5:58 AM, lutefish said:

I'm suddenly getting a new error that precludes all use (with Alfred 5, so perhaps I should post it over there?) "NoneType object is not subscriptable" 

 

Let me know if you need more to figure out what's changed.

 

I am now getting the same error. I have decided to go with the alternate suggested on this thread.

Link to comment
On 7/8/2022 at 3:58 AM, lutefish said:

I'm suddenly getting a new error that precludes all use (with Alfred 5, so perhaps I should post it over there?) "NoneType object is not subscriptable" 

 

Let me know if you need more to figure out what's changed.

Most of such errors can be remove by update the data through zothero configuration. It works well until the newest  Alfred 5 version. It's really strange that zothero still work for the Alfred 5 beta version.

Link to comment

I find the workflow doesn't work any more, when you type to search something it just returns nothing. here is the debug info

 

[13:48:29.481] Logging Started...
[13:48:34.579] ERROR: ZotHero[Script Filter] Code 126: /Users/yutang/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/AC95751A-F50A-4B1B-91C9-32B6066AD3F3: ./zh: /usr/bin/python: bad interpreter: No such file or directory
[13:48:34.756] ERROR: ZotHero[Script Filter] Code 126: /Users/yutang/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/AC95751A-F50A-4B1B-91C9-32B6066AD3F3: ./zh: /usr/bin/python: bad interpreter: No such file or directory
[13:48:35.344] ERROR: ZotHero[Script Filter] Code 126: /Users/yutang/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/AC95751A-F50A-4B1B-91C9-32B6066AD3F3: ./zh: /usr/bin/python: bad interpreter: No such file or directory

 

Could you please tell me what's the problem? I believe that I've have python3 installed on my Mac

Link to comment

When asking about an existing Workflow, it’s best to use its own forum thread. While it may seem that starting a new thread could give your problem visibility, it fragments the discussion and makes it less likely the author and users of the workflow (the people who can help) will see it.

 

I have moved the post to the correct thread.

 

6 hours ago, YuTang said:

I believe that I've have python3 installed on my Mac

 

But not the correct version of the Workflow. Use @giovanni’s fork.

Link to comment
  • 3 months later...

FYI, this stopped working (again) after updating to Mac OS 13.

 

Looking at the debugger gave the following error: 

 

 Code 1: xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

 

Re-loading the Command Line Developer Tools (terminal, xcode-select --install) fixed the issue.

 

Link to comment
  • 2 weeks later...
On 7/23/2022 at 7:18 AM, grothen said:

I find the bug. The Zotero or some new extension use link as "...library/items..."  while the url get by zothero is  ".../items/1_...". It works after I modify the url.

 

Hi,

Can you share where you did the change?

I updated Alfred 5.0.5 and suddenly see the

 "NoneType object is not subscriptable" 

 error.

 

Thanks!

 

 

Edit:

Reinstall the workflow does not solve the issue.

go to "zotconf" and choose "Reload Zotero Data" has resolved the issue for me.

 

Edited by nituren
found a solution.
Link to comment
  • 5 months later...

Hello! I've moved to a new computer, and as I get everything migrated over, a small hiccup. (Well, some big hiccups as Box.com moved everything around, but that's a different question)

 

Zothero works, broadly (it loads the database, searches it, and can open files and open items in Zotero).

 

But, when I go to copy citations,I'm encountering a permissions error. Looking at the log file, the text is all there from Zotero, but it's failing to copy.

 

8:22:05 workflow.py:2114 ERROR    [Errno 13] Permission denied: '/Users/USERNAME/Library/CloudStorage/Box-Box/AlfredSync/Alfred.alfredpreferences/workflows/user.workflow.3181B68E-1DF7-497C-B4A8-A4EF8190FFA8/lib/cite/cite'

Traceback (most recent call last):
  File "/Users/USERNAME/Library/CloudStorage/Box-Box/AlfredSync/Alfred.alfredpreferences/workflows/user.workflow.3181B68E-1DF7-497C-B4A8-A4EF8190FFA8/lib/workflow/workflow.py", line 2107, in run
    func(self)

 

Any thoughts? I've checked and Alfred has Automation, Accessibility, and Full Disk access.

 

Thanks.

Link to comment
  • 2 months later...
On 7/8/2018 at 2:45 PM, deanishe said:

icon.png.a71a60eae67f26d26739fa072abe6e69.png

 

ZotHero


Rapidly search your Zotero database and copy citations.


https://github.com/deanishe/zothero


Features

  • Perform full-text search across your Zotero database, including only searching specific fields
  • Copy citations using any CSL style you have installed in Zotero
  • Copy citations either in citation/note style or bibliography style
  • Copy citations in any locale supported by CSL
  • Citations are copied in multiple formats, so the right data are automatically pasted into the application you're using
  • Trigger search while you type using the Snippet Trigger (you must assign the snippet keyword yourself in Alfred Preferences)

 


Download & installation


Download the ZotHero-XYZ.alfredworkflow file from GitHub releases, and double-click the downloaded file to install.


Basic usage


These are the workflow's default keywords:

  • zot <query> — Search your Zotero database (common fields).
  • zot:[<query>] — Search a specific field.
  • zotconf [<query>] — View and edit workflow configuration.

 


See the README on GitHub for full instructions.


Pasting citations


When you copy a citation, ZotHero puts both HTML and rich text (RTF) representations on the pasteboard. That way, when you paste a citation into an application like Word, the formatted text will be pasted, but when you paste into a text/Markdown document, the HTML will be pasted.


Licence & thanks


The workflow is released under the MIT licence.


The Zorro icon was created by Dan Lowenstein.


Citations are generated by citeproc-js (AGPLv3).


Workflow stuff is taken care of by Alfred-Workflow (also MIT licence).

 

Great job! It will help me very much in my academic work. But, please, I have a question: Is there a way to fill Zotero fields from within the Alfred app? Thank you very much.

Link to comment
  • 1 month later...
On 7/8/2018 at 2:45 PM, deanishe said:

icon.png.a71a60eae67f26d26739fa072abe6e69.png

 

ZotHero


Rapidly search your Zotero database and copy citations.


https://github.com/deanishe/zothero


Features

  • Perform full-text search across your Zotero database, including only searching specific fields
  • Copy citations using any CSL style you have installed in Zotero
  • Copy citations either in citation/note style or bibliography style
  • Copy citations in any locale supported by CSL
  • Citations are copied in multiple formats, so the right data are automatically pasted into the application you're using
  • Trigger search while you type using the Snippet Trigger (you must assign the snippet keyword yourself in Alfred Preferences)

 


Download & installation


Download the ZotHero-XYZ.alfredworkflow file from GitHub releases, and double-click the downloaded file to install.


Basic usage


These are the workflow's default keywords:

  • zot <query> — Search your Zotero database (common fields).
  • zot:[<query>] — Search a specific field.
  • zotconf [<query>] — View and edit workflow configuration.

 


See the README on GitHub for full instructions.


Pasting citations


When you copy a citation, ZotHero puts both HTML and rich text (RTF) representations on the pasteboard. That way, when you paste a citation into an application like Word, the formatted text will be pasted, but when you paste into a text/Markdown document, the HTML will be pasted.


Licence & thanks


The workflow is released under the MIT licence.


The Zorro icon was created by Dan Lowenstein.


Citations are generated by citeproc-js (AGPLv3).


Workflow stuff is taken care of by Alfred-Workflow (also MIT licence).

Hi @deanishe,

Thank you so much for this great workflow. I have a problem: since I used now new Mac, the work flow doesn't work. I putted the directory of Zotero data in the configuration sheet, but it still not working> this is the debugger report:

 

[14:12:32.101] ZotHero[Script Filter] Queuing argument 'poetry'
[14:12:32.110] ZotHero[Script Filter] Script with argv 'poetry' finished
[14:12:32.111] ERROR: ZotHero[Script Filter] Code 126:~/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/93AF91FC-0AA8-4B1A-B48E-9995F722770D: ./zh: /usr/bin/python: bad interpreter: No such file or directory

 

can you help?

Thank you so much.

Edited by Faris Najem
Link to comment
33 minutes ago, vitor said:

@Faris Najem What you’re experiencing is the removal of Python 2 from macOS. Use the fork by @giovanni.

@vitorThank you so much for your quick response. I did download the latest version as you refer to it. Now I have this error:


FileNotFoundError: [Errno 2] No such file or directory: '/Users/farisal-mawwashi/Zotero/better-bibtex.sqlite'
14:36:18 workflow.py:2116 INFO     for assistance, see: https://github.com/giovannicoppola/zothero/issues
14:36:18 workflow.py:2136 DEBUG    ---------- finished in 0.028s ----------
[14:36:18.523] ZotHero[Script Filter] {
  "items": [
    {
      "title": "Error in workflow 'ZotHero'",
      "subtitle": "[Errno 2] No such file or directory: '/Users/farisal-mawwashi/Zotero/better-bibtex.sqlite'",
      "valid": false,
      "icon": {
        "path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"
      }
    }
  ]
}

Edited by Faris Najem
Link to comment
19 hours ago, giovanni said:

@Faris Najem have you installed Better BibTeX in Zotero?

https://retorque.re/zotero-better-bibtex/installation/

 

Hi @giovanni,

Thank you so much for your helpful answer. Now, after I installed Better BibTeX, the resources are starting to show up. But, please, I just have a problem with the the Arabic-Indic numerals (١٢٣٤٥٦٧٨٩٠). When I use them in any field, the field appears empty. As in the following result:

 

Frauke Berndt and Anthony Mahler, Facing Poetry: Alexander Gottlieb Baumgarten's Theory of Literature (Berlin: De Gruyter, n.d.).

 

"n.d" means (No date) when in fact I put the publishing year in the usual field for that, but in the language. I chose an English resource (with these numerals) just to clarify because the problem I have with Arab resources, with which I use these numbers.

The attached screenshot is the Citation as I put in Zotero.

I'll be very thankful for the help.

(Note: The problem gets with all patterns, and in this example has used Chicago style, 17th, full note).

Thank you again.

 

Screenshot 2023-07-22 at 2.32.42 PM.png

Link to comment
1 hour ago, Faris Najem said:

When I use them in any field, the field appears empty.

are you referring to Zotero (the reference management software), or Zothero (the Alfred workflow)? Are you able to enter Arabic numerals in Zotero? If not, the problem is with Zotero. 

Link to comment
8 hours ago, giovanni said:

are you referring to Zotero (the reference management software), or Zothero (the Alfred workflow)? Are you able to enter Arabic numerals in Zotero? If not, the problem is with Zotero. 

Thank you @giovanni.

I'm talking about the way that the workflow ZotHero is dealing with the Arabic numerals which are used in the app Zotero. If I use Zotero itself to generate a citation has these numerals, then the result is ok, but if I use ZotHero to generate the same citation then the result is like what I talked about in the previous post. So, I think the problem is in the relationship between ZotHero and the Arabic numerals.

 

Thank you again for your response and help.

 

Link to comment
2 hours ago, giovanni said:

@Faris Najem I tested the use of Eastern Arabic numerals and it seems to work fine both in the Alfred window and in the pasted reference. Could you check if you see the same problem in other fields (for example, add an Arabic numeric character to volume or author name)? 

@giovanni It seems that the problem is only in the "date" field, here you find results for both Zotero and ZotHero:

By Zotero app:
Benedetto Croce, Aesthetic as Science of Expression and General Linguistic, trans. Douglas Ainslie, ٢٢, vol. ١ (London: Macmillan, ١٩٩٩).

By ZotHero workflow:
Benedetto Croce, Aesthetic as Science of Expression and General Linguistic, trans. Douglas Ainslie, ٢٢, vol. ١ (London: Macmillan, n.d.).

 

Thank you again.

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...