Code Monkey home page Code Monkey logo

zothero's Introduction

ZotHero

Alfred workflow for rapidly searching your Zotero database and copying citations.

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
  • Copy Better BibTeX citekeys
  • 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.

Note: Versions 1.3.0 and later are only compatible with Alfred 4+. If you're still using Alfred 3, download v1.2.2.

Usage

These are the workflow's default keywords in Alfred:

  • zot <query> — Search your Zotero database (common fields).

    • — Open the entry in Zotero. (fn+↩ is an alternate)
    • ⌘↩ — Copy citation to the pasteboard (see Configuration).
    • ⌥↩ — Copy bibliography-style citation to the pasteboard (see Configuration).
    • ⇧↩ — View entry attachments (if present).
      • — Open an attachment in the default application.
    • ^↩ — View all citation styles.
      • or ⌘↩ — Copy citation in selected style.
      • ⌥↩ — Copy bibliography-style citation in selected style.
      • ^↩ — Set style as default.
    • This search can also be triggered by typing a snippet (which you must first assign yourself in Alfred Preferences)
    • When the Better-Bibtex plugin for Zotero is installed and COPY_CITEKEY_MOD is set to any of -(no modifier), alt, ctrl, cmd, fn, shift, the "Copy citekey" functionality can be enabled to override above operations
  • zot:[<query>] — Search a specific field.

    • — Select a field to search against.
  • zotconf [<query>] — View and edit workflow configuration.

    • An Update is Available / Workflow is Up To Date — Whether a newer version of the workflow is available.
    • Default Style: … — Choose a citation style for the ⌘↩ and ⌥↩ hotkeys (on search results).
    • Locale: … — Choose a locale for the formatting of citations. If unset, the default for the style is used, or if none is set, US English.
    • Reload Zotero Cache — Clear the workflow's cache of Zotero data. Useful if the workflow gets out of sync with Zotero.
    • Open Log File — Open the workflows log file in the default app (usually Console.app). Useful for checking on indexing problems (the indexer output isn't visible in Alfred's debugger).
    • View Documentation — Open this README in your browser.
    • Report an Issue — Open the GitHub issue tracker in your browser.

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.

Configuration

The workflow reads Zotero's own config files and partly manages its own configuration with the keyword zotconf, but you may need to use the workflow configuration sheet if the workflow can't read Zotero's config files.

NOTE: Unlike its main database, Zotero does not save changes to its configuration until the application closes. As such, if you change Zotero's data or attachment directories, the workflow won't see the changes until you quit Zotero.

Zotero data

The workflow uses your Zotero database and styles, therefore it needs to know where to find them. The workflow tries to read Zotero's own configuration files, and falls back to ~/Zotero (the default location for Zotero 5).

If the workflow can't find your data, you need to set ZOTERO_DIR in the workflow configuration sheet.

Similarly, if you have set a "Linked Attachment Base Directory" in Zotero, but the workflow can't find the directory, enter its path for ATTACHMENTS_DIR in the configuration sheet.

Note: You can use the UNIX shortcut ~ to represent your home directory, e.g. ~/Zotero for Zotero 5's default directory.

Citation styles

The workflow uses the CSL styles you have installed in Zotero, so to add a new style, simply add it in Zotero. The workflow will pick up the new style(s) on the next run.

You can copy either a citation-/note-style citation or a bibliography-style one by hitting ⌘↩ or ⌥↩ respectively on a search result or citation style.

For ⌘↩ and ⌥↩ to work on search results, you must first choose a default style. You can either do this in the configuration screen (keyword zotconf), or hitting ^↩ on a search result to show all citation styles, then ^↩ on a style to set that as the default.

Locales

CSL and ZotHero support the following locales. The default behaviour is to use the locale specified in the style if there is one, and en-US (American English) if not. Setting a locale overrides the style's own locale.

Use the zotconf keyword to force a specific locale.

Locale Code
Afrikaans af-ZA
Bahasa Indonesia / Indonesian id-ID
Català / Catalan ca-AD
Cymraeg / Welsh cy-GB
Dansk / Danish da-DK
Deutsch (Deutschland) / German (Germany) de-DE
Deutsch (Schweiz) / German (Switzerland) de-CH
Deutsch (Österreich) / German (Austria) de-AT
Eesti / Estonian et-EE
English (UK) en-GB
English (US) en-US
Español (Chile) / Spanish (Chile) es-CL
Español (España) / Spanish (Spain) es-ES
Español (México) / Spanish (Mexico) es-MX
Euskara / Basque eu
Français (Canada) / French (Canada) fr-CA
Français (France) / French (France) fr-FR
Hrvatski / Croatian hr-HR
Italiano / Italian it-IT
Latviešu / Latvian lv-LV
Lietuvių / Lithuanian lt-LT
Magyar / Hungarian hu-HU
Nederlands / Dutch nl-NL
Norsk bokmål / Norwegian (Bokmål) nb-NO
Norsk nynorsk / Norwegian (Nynorsk) nn-NO
Polski / Polish pl-PL
Português (Brasil) / Portuguese (Brazil) pt-BR
Português (Portugal) / Portuguese (Portugal) pt-PT
Română / Romanian ro-RO
Slovenčina / Slovak sk-SK
Slovenščina / Slovenian sl-SI
Suomi / Finnish fi-FI
Svenska / Swedish sv-SE
Tiếng Việt / Vietnamese vi-VN
Türkçe / Turkish tr-TR
Íslenska / Icelandic is-IS
Čeština / Czech cs-CZ
Ελληνικά / Greek el-GR
Български / Bulgarian bg-BG
Монгол / Mongolian mn-MN
Русский / Russian ru-RU
Српски / Srpski / Serbian sr-RS
Українська / Ukrainian uk-UA
עברית / Hebrew he-IL
العربية / Arabic ar
فارسی / Persian fa-IR
ไทย / Thai th-TH
ភាសាខ្មែរ / Khmer km-KH
中文 (**大陆) / Chinese (PRC) zh-CN
中文 (台灣) / Chinese (Taiwan) zh-TW
日本語 / Japanese ja-JP
한국어 / Korean ko-KR

All settings

Theses are all settings available in the workflow configuration sheet.

You probably shouldn't edit the CITE_STYLE or LOCALE variables yourself, as there's no guarantee the value you set is actually available. Adjust them using the zotconf keyword.

Variable Meaning
ATTACHMENTS_DIR Path to your Zotero attachments. Read from Zotero's config by default.
CITE_STYLE Citation style copied by ⌘↩ and ⌥↩
LOCALE Locale for citations. Default: en-US (US English).
ZOTERO_DIR Path to your Zotero data. Read from Zotero's config by default.
COPY_CITEKEY_MOD Set to copy Better BibTeX citekey instead of CSL citation/bibliography.

Licence & thanks

This workflow is released under the MIT licence.

It is heavily based on Alfred-Workflow (also MIT) for the workflow stuff, and citeproc-js (AGPL) for generating the citations.

It was inspired by the now-defunct ZotQuery by @fractaledmind.

The Zorro icon was created by Dan Lowenstein from the Noun Project.

zothero's People

Contributors

deanishe avatar dependabot-preview[bot] avatar yarray avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zothero's Issues

ZotHero Showing Attachments as Entrys

Hi,

Just wanted to point out an error/bug which I keep getting after a fresh installation on my macbook pro. So basically it keeps showing me my zotero attachments as "entrys" in my zot Search. Anyone has an idea on how to fix this? I tried reinstalling zotero/alfred multiple times already.

image

zot: citekey --- enhancement request

I have an enhancement request.

It would be helpful if in the zot: search options, citekey could be searched. I write in markdown using BetterBibLatex. Quickly being able to search from an entry e.g., [@author2018] would be a useful feature.

Thanks for a great workflow!

Citations for caselaw

The workflow doesn't seem to be querying case names. For example, querying a case titled Doe v. Snyder, I get the following

image

Works great for journal articles, and if I could figure out how to get it to play nice with caselaw that would be stellar

Installation question

  • I have installed Alfred 4.0 on Catalina
  • I have bought the key for the powerpack and installed it
  • I have a copy of my Zotero 5

The problem is that I don't know whether the installation is successful. I've tried the command instruction but I am not sure whether the result I got is correct.

zotconf [<query>] for example. I don't know whether this means typing "zotconf [ insert query ]" or something else. I am also not sure about zot:[<query>] because this doesn't work either.

add fuzzy search support

It would be good if this workflow had the ability to use fuzzy search, maybe with ripgrep or similar to find citations. Not sure if and how this would be done, but this feature to search bibliography entries could be helpful.

Can't update any settings

Below is the debugger output when I tried to config the citation style. Nothing happens after I clicked enter. Same goes for other settings. Below is the debugger output. I am using alfred 4.0.9. It seems to be similar to #22 but you said you have updated for alfred 4 already so I don't know what's going on.

[10:39:02.668] Logging Started...
[10:39:17.123] ZotHero[Script Filter] Queuing argument ''
[10:39:17.307] ZotHero[Script Filter] Script with argv '' finished
[10:39:17.311] STDERR: ZotHero[Script Filter] .
10:39:17 workflow.py:2061 DEBUG ---------- ZotHero (1.3.0) ----------
10:39:17 workflow.py:1468 DEBUG reading settings from /Users/student-t/Library/Application Support/Alfred/Workflow Data/net.deanishe.alfred.zothero/settings.json
10:39:17 workflow.py:2343 DEBUG update check not due
10:39:17 zh:667 DEBUG args={'--bibliography': False,
'--help': False,
'--paste': False,
'--style': None,
'--text': None,
'--title': None,
'': None,
'': None,
'': None,
'': u'',
'<style>': None,
'': None,
'attachments': False,
'citations': False,
'clear': False,
'config': True,
'copy': False,
'fields': False,
'locale': False,
'notify': False,
'reindex': False,
'search': False,
'setvar': False,
'style': False}
10:39:17 config.py:88 DEBUG [config] attachdir=u'/Volumes/My Passport/Data/GoogleDrive/paper'
10:39:17 config.py:85 DEBUG [config] datadir=u'/Users/student-t/Zotero'
10:39:17 core.py:72 DEBUG [core] cachedir=u'/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/net.deanishe.alfred.zothero'
10:39:17 core.py:73 DEBUG [core] zotero_dir=u'
/Zotero'
10:39:17 core.py:74 DEBUG [core] attachments_dir=u'/Volumes/My Passport/Data/GoogleDrive/paper'
10:39:17 workflow.py:1695 DEBUG loading cached data: /Users/student-t/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/net.deanishe.alfred.zothero/__workflow_latest_version.cpickle
10:39:17 workflow.py:2254 DEBUG set last run version: 1.3.0
10:39:17 workflow.py:2103 DEBUG ---------- finished in 0.030s ----------
[10:39:17.314] ZotHero[Script Filter] {"items": [{"autocomplete": "workflow:update", "valid": false, "subtitle": "\u21a9 or \u21e5 to force update check", "icon": {"path": "icons/update-ok.png"}, "title": "Workflow is Up To Date"}, {"variables": {"action": "choose-style", "varname": "CITE_STYLE", "style": ""}, "valid": true, "subtitle": "\u21a9 to change style", "icon": {"path": "icons/off.png"}, "title": "Default Style: None"}, {"variables": {"action": "choose-locale", "varname": "LOCALE"}, "valid": true, "subtitle": "\u21a9 to change locale", "icon": {"path": "icons/locale.png"}, "title": "Locale: Default (US English)"}, {"variables": {"action": "reload"}, "valid": true, "subtitle": "Re-read your Zotero database", "icon": {"path": "icons/reload.png"}, "title": "Reload Zotero Data"}, {"autocomplete": "workflow:openlog", "valid": false, "subtitle": "Open workflow log file in default app", "icon": {"path": "icons/log.png"}, "title": "Open Log File"}, {"subtitle": "Open the documentation in your browser", "title": "View Documentation", "variables": {"url": "https://github.com/deanishe/zothero/blob/master/README.md", "action": "open-url"}, "valid": true, "arg": "https://github.com/deanishe/zothero/blob/master/README.md", "icon": {"path": "icons/docs.png"}}, {"subtitle": "Open GitHub issue tracker in your browser", "title": "Report an Issue", "variables": {"url": "https://github.com/deanishe/zothero/issues", "action": "open-url"}, "valid": true, "arg": "https://github.com/deanishe/zothero/issues", "icon": {"path": "icons/issue.png"}}]}
[10:39:21.315] ZotHero[Script Filter] Processing complete
[10:39:21.316] ZotHero[Script Filter] Passing output '' to Debug
[10:39:21.335] ZotHero[Debug] .
/----------- CONF OUT -----------
query=
variables={
action = "choose-style"
ATTACHMENTS_DIR = ""
CITE_STYLE = ""
COPY_CITEKEY_MOD = ""
LOCALE = ""
style = ""
varname = "CITE_STYLE"
ZOTERO_DIR = "/Zotero"
}
--------------------------------/
[10:39:21.336] ZotHero[Debug] Processing complete
[10:39:21.337] ZotHero[Debug] Passing output '' to Filter
[10:39:21.337] ZotHero[Filter] Processing complete
[10:39:21.338] ZotHero[Filter] Passing output '' to Script Filter
[10:39:21.338] ZotHero[Debug] Passing output '' to Filter
[10:39:21.339] ZotHero[Debug] Passing output '' to Filter
[10:39:21.339] ZotHero[Debug] Passing output '' to Filter
[10:39:21.340] ZotHero[Script Filter] Queuing argument ''
[10:39:21.424] ZotHero[Script Filter] Script with argv '' finished
[10:39:21.425] STDERR: ZotHero[Script Filter] .
10:39:21 workflow.py:2061 DEBUG ---------- ZotHero (1.3.0) ----------
10:39:21 workflow.py:1468 DEBUG reading settings from /Users/student-t/Library/Application Support/Alfred/Workflow Data/net.deanishe.alfred.zothero/settings.json
10:39:21 workflow.py:2343 DEBUG update check not due
10:39:21 zh:667 DEBUG args={'--bibliography': False,
'--help': False,
'--paste': False,
'--style': None,
'--text': None,
'--title': None,
'': None,
'': None,
'': None,
'': u'',
'<style>': None,
'': None,
'attachments': False,
'citations': False,
'clear': False,
'config': False,
'copy': False,
'fields': False,
'locale': False,
'notify': False,
'reindex': False,
'search': False,
'setvar': False,
'style': True}
10:39:21 config.py:88 DEBUG [config] attachdir=u'/Volumes/My Passport/Data/GoogleDrive/paper'
10:39:21 config.py:85 DEBUG [config] datadir=u'/Users/student-t/Zotero'
10:39:21 core.py:72 DEBUG [core] cachedir=u'
/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/net.deanishe.alfred.zothero'
10:39:21 core.py:73 DEBUG [core] zotero_dir=u'/Zotero'
10:39:21 core.py:74 DEBUG [core] attachments_dir=u'/Volumes/My Passport/Data/GoogleDrive/paper'
10:39:21 core.py:133 DEBUG [core] storage=u'
/Zotero/storage'
10:39:21 core.py:134 DEBUG [core] styles=u'/Zotero/styles'
10:39:21 cache.py:311 DEBUG [cache] opening store 'styles'...
10:39:21 cache.py:311 DEBUG [cache] opening store 'modtimes'...
10:39:21 workflow.py:2254 DEBUG set last run version: 1.3.0
10:39:21 workflow.py:2103 DEBUG ---------- finished in 0.049s ----------
[10:39:21.430] ZotHero[Script Filter] {"items": [{"variables": {"varval": "http://www.zotero.org/styles/american-chemical-society", "next": "config"}, "valid": true, "subtitle": "\u21a9 to set as default style", "icon": {"path": "icons/off.png"}, "title": "American Chemical Society"}, {"variables": {"varval": "http://www.zotero.org/styles/american-medical-association", "next": "config"}, "valid": true, "subtitle": "\u21a9 to set as default style", "icon": {"path": "icons/off.png"}, "title": "American Medical Association 11th edition"}, {"variables": {"varval": "http://www.zotero.org/styles/american-political-science-association", "next": "config"}, "valid": true, "subtitle": "\u21a9 to set as default style", "icon": {"path": "icons/off.png"}, "title": "American Political Science Association"}, {"variables": {"varval": "http://www.zotero.org/styles/american-sociological-association", "next": "config"}, "valid": true, "subtitle": "\u21a9 to set as default style", "icon": {"path": "icons/off.png"}, "title": "American Sociological Association 6th edition"}, {"variables": {"varval": "http://www.zotero.org/styles/apa", "next": "config"}, "valid": true, "subtitle": "\u21a9 to set as default style", "icon": {"path": "icons/off.png"}, "title": "American Psychological Association 7th edition"}, {"variables": {"varval": "http://www.zotero.org/styles/chicago-author-date", "next": "config"}, "valid": true, "subtitle": "\u21a9 to set as default style", "icon": {"path": "icons/off.png"}, "title": "Chicago Manual of Style 17th edition (author-date)"}, {"variables": {"varval": "http://www.zotero.org/styles/chicago-fullnote-bibliography", "next": "config"}, "valid": true, "subtitle": "\u21a9 to set as default style", "icon": {"path": "icons/off.png"}, "title": "Chicago Manual of Style 17th edition (full note)"}, {"variables": {"varval": "http://www.zotero.org/styles/chicago-note-bibliography", "next": "config"}, "valid": true, "subtitle": "\u21a9 to set as default style", "icon": {"path": "icons/off.png"}, "title": "Chicago Manual of Style 17th edition (note)"}, {"variables": {"varval": "http://www.zotero.org/styles/elsevier-harvard", "next": "config"}, "valid": true, "subtitle": "\u21a9 to set as default style", "icon": {"path": "icons/off.png"}, "title": "Elsevier - Harvard (with titles)"}, {"variables": {"varval": "http://www.zotero.org/styles/harvard-cite-them-right", "next": "config"}, "valid": true, "subtitle": "\u21a9 to set as default style", "icon": {"path": "icons/off.png"}, "title": "Cite Them Right 10th edition - Harvard"}, {"variables": {"varval": "http://www.zotero.org/styles/ieee", "next": "config"}, "valid": true, "subtitle": "\u21a9 to set as default style", "icon": {"path": "icons/off.png"}, "title": "IEEE"}, {"variables": {"varval": "http://www.zotero.org/styles/modern-humanities-research-association", "next": "config"}, "valid": true, "subtitle": "\u21a9 to set as default style", "icon": {"path": "icons/off.png"}, "title": "Modern Humanities Research Association 3rd edition (note with bibliography)"}, {"variables": {"varval": "http://www.zotero.org/styles/modern-language-association", "next": "config"}, "valid": true, "subtitle": "\u21a9 to set as default style", "icon": {"path": "icons/off.png"}, "title": "Modern Language Association 8th edition"}, {"variables": {"varval": "http://www.zotero.org/styles/nature", "next": "config"}, "valid": true, "subtitle": "\u21a9 to set as default style", "icon": {"path": "icons/off.png"}, "title": "Nature"}, {"variables": {"varval": "http://www.zotero.org/styles/vancouver", "next": "config"}, "valid": true, "subtitle": "\u21a9 to set as default style", "icon": {"path": "icons/off.png"}, "title": "Vancouver"}]}
[10:39:24.107] ZotHero[Script Filter] Processing complete
[10:39:24.119] ZotHero[Script Filter] Passing output '' to Call External Trigger
[10:39:24.120] ZotHero[External] Processing complete
[10:39:24.120] ZotHero[External] Passing output '' to Debug
[10:39:24.121] ZotHero[Debug] .
/----------- SETVAR IN -----------
query=
variables={
action = "choose-style"
ATTACHMENTS_DIR = ""
CITE_STYLE = ""
COPY_CITEKEY_MOD = ""
LOCALE = ""
next = "config"
style = ""
varname = "CITE_STYLE"
varval = "http://www.zotero.org/styles/ieee"
ZOTERO_DIR = "
/Zotero"
}
---------------------------------/
[10:39:24.122] ZotHero[Debug] Processing complete
[10:39:24.123] ZotHero[Debug] Passing output '' to Run Script
[10:39:24.397] STDERR: ZotHero[Run Script] .
10:39:24 workflow.py:2061 DEBUG ---------- ZotHero (1.3.0) ----------
10:39:24 workflow.py:1468 DEBUG reading settings from /Users/student-t/Library/Application Support/Alfred/Workflow Data/net.deanishe.alfred.zothero/settings.json
10:39:24 workflow.py:2343 DEBUG update check not due
10:39:24 zh:667 DEBUG args={'--bibliography': False,
'--help': False,
'--paste': False,
'--style': None,
'--text': None,
'--title': None,
'': None,
'': None,
'': u'CITE_STYLE',
'': None,
'<style>': None,
'': u'http://www.zotero.org/styles/ieee',
'attachments': False,
'citations': False,
'clear': False,
'config': False,
'copy': False,
'fields': False,
'locale': False,
'notify': False,
'reindex': False,
'search': False,
'setvar': True,
'style': False}
10:39:24 config.py:88 DEBUG [config] attachdir=u'/Volumes/My Passport/Data/GoogleDrive/paper'
10:39:24 config.py:85 DEBUG [config] datadir=u'/Users/student-t/Zotero'
10:39:24 core.py:72 DEBUG [core] cachedir=u'/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/net.deanishe.alfred.zothero'
10:39:24 core.py:73 DEBUG [core] zotero_dir=u'
/Zotero'
10:39:24 core.py:74 DEBUG [core] attachments_dir=u'/Volumes/My Passport/Data/GoogleDrive/paper'
10:39:24 zh:609 DEBUG [settings] setting "CITE_STYLE" to "http://www.zotero.org/styles/ieee" ...
execution error: Error: Error: An error occurred. (-1743)
10:39:24 workflow.py:2080 ERROR Command '['/usr/bin/osascript', '-l', 'JavaScript', '-e', 'Application("com.runningwithcrayons.Alfred").setConfiguration("CITE_STYLE", {"exportable": true, "inWorkflow": "net.deanishe.alfred.zothero", "toValue": "http://www.zotero.org/styles/ieee"});']' returned non-zero exit status 1
Traceback (most recent call last):
File "./lib/workflow/workflow.py", line 2073, in run
func(self)
File "./zh", line 723, in main
return do_setvar(args[''], args[''])
File "./zh", line 610, in do_setvar
set_config(key, value, exportable=True)
File "./lib/workflow/util.py", line 292, in set_config
run_applescript(script, lang='JavaScript')
File "./lib/workflow/util.py", line 219, in run_applescript
return run_command(cmd, **kwargs)
File "./lib/workflow/util.py", line 184, in run_command
return subprocess.check_output(cmd, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 223, in check_output
raise CalledProcessError(retcode, cmd, output=output)
CalledProcessError: Command '['/usr/bin/osascript', '-l', 'JavaScript', '-e', 'Application("com.runningwithcrayons.Alfred").setConfiguration("CITE_STYLE", {"exportable": true, "inWorkflow": "net.deanishe.alfred.zothero", "toValue": "http://www.zotero.org/styles/ieee"});']' returned non-zero exit status 1
10:39:24 workflow.py:2082 INFO for assistance, see: https://github.com/deanishe/zothero/issues
10:39:24 workflow.py:2103 DEBUG ---------- finished in 0.117s ----------
[10:39:24.400] ZotHero[Run Script] Processing complete
[10:39:24.401] ZotHero[Run Script] Passing output '{"items": [{"valid": false, "subtitle": "Command '['/usr/bin/osascript', '-l', 'JavaScript', '-e', 'Application("com.runningwithcrayons.Alfred").setConfiguration("CITE_STYLE", {"exportable": true, "inWorkflow": "net.deanishe.alfred.zothero", "toValue": "http://www.zotero.org/styles/ieee"});']' returned non-zero exit status 1", "icon": {"path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"}, "title": "Error in workflow 'ZotHero'"}]}' to Call External Trigger
[10:39:24.402] ZotHero[External] Processing complete
[10:39:24.402] ZotHero[External] Passing output '' to Run Script
[10:39:24.403] ZotHero[Run Script] Passing output '{"items": [{"valid": false, "subtitle": "Command '['/usr/bin/osascript', '-l', 'JavaScript', '-e', 'Application("com.runningwithcrayons.Alfred").setConfiguration("CITE_STYLE", {"exportable": true, "inWorkflow": "net.deanishe.alfred.zothero", "toValue": "http://www.zotero.org/styles/ieee"});']' returned non-zero exit status 1", "icon": {"path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"}, "title": "Error in workflow 'ZotHero'"}]}' to Filter
[10:39:24.404] ZotHero[Filter] Processing complete
[10:39:24.404] ZotHero[Filter] Passing output '{"items": [{"valid": false, "subtitle": "Command '['/usr/bin/osascript', '-l', 'JavaScript', '-e', 'Application("com.runningwithcrayons.Alfred").setConfiguration("CITE_STYLE", {"exportable": true, "inWorkflow": "net.deanishe.alfred.zothero", "toValue": "http://www.zotero.org/styles/ieee"});']' returned non-zero exit status 1", "icon": {"path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"}, "title": "Error in workflow 'ZotHero'"}]}' to Call External Trigger
[10:39:24.419] ZotHero[External] Processing complete
[10:39:24.420] ZotHero[External] Passing output '' to Script Filter
[10:39:24.421] ZotHero[Script Filter] Queuing argument ''
[10:39:24.556] STDERR: ZotHero[Run Script] .
10:39:24 workflow.py:2061 DEBUG ---------- ZotHero (1.3.0) ----------
10:39:24 workflow.py:1468 DEBUG reading settings from /Users/student-t/Library/Application Support/Alfred/Workflow Data/net.deanishe.alfred.zothero/settings.json
10:39:24 workflow.py:2343 DEBUG update check not due
10:39:24 zh:667 DEBUG args={'--bibliography': False,
'--help': False,
'--paste': False,
'--style': None,
'--text': None,
'--title': None,
'': None,
'': None,
'': None,
'': None,
'<style>': None,
'': None,
'attachments': False,
'citations': False,
'clear': False,
'config': False,
'copy': False,
'fields': False,
'locale': False,
'notify': True,
'reindex': False,
'search': False,
'setvar': False,
'style': False}
10:39:24 config.py:88 DEBUG [config] attachdir=u'/Volumes/My Passport/Data/GoogleDrive/paper'
10:39:24 config.py:85 DEBUG [config] datadir=u'/Users/student-t/Zotero'
10:39:24 core.py:72 DEBUG [core] cachedir=u'/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/net.deanishe.alfred.zothero'
10:39:24 core.py:73 DEBUG [core] zotero_dir=u'
/Zotero'
10:39:24 core.py:74 DEBUG [core] attachments_dir=u'/Volumes/My Passport/Data/GoogleDrive/paper'
10:39:24 zh:627 DEBUG ignoring empty notification
10:39:24 workflow.py:2254 DEBUG set last run version: 1.3.0
10:39:24 workflow.py:2103 DEBUG ---------- finished in 0.041s ----------
[10:39:24.585] ZotHero[Script Filter] Script with argv '' finished
[10:39:24.586] STDERR: ZotHero[Script Filter] .
10:39:24 workflow.py:2061 DEBUG ---------- ZotHero (1.3.0) ----------
10:39:24 workflow.py:1468 DEBUG reading settings from /Users/student-t/Library/Application Support/Alfred/Workflow Data/net.deanishe.alfred.zothero/settings.json
10:39:24 workflow.py:2343 DEBUG update check not due
10:39:24 zh:667 DEBUG args={'--bibliography': False,
'--help': False,
'--paste': False,
'--style': None,
'--text': None,
'--title': None,
'': None,
'': None,
'': None,
'': u'',
'<style>': None,
'': None,
'attachments': False,
'citations': False,
'clear': False,
'config': True,
'copy': False,
'fields': False,
'locale': False,
'notify': False,
'reindex': False,
'search': False,
'setvar': False,
'style': False}
10:39:24 config.py:88 DEBUG [config] attachdir=u'/Volumes/My Passport/Data/GoogleDrive/paper'
10:39:24 config.py:85 DEBUG [config] datadir=u'/Users/student-t/Zotero'
10:39:24 core.py:72 DEBUG [core] cachedir=u'/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/net.deanishe.alfred.zothero'
10:39:24 core.py:73 DEBUG [core] zotero_dir=u'
/Zotero'
10:39:24 core.py:74 DEBUG [core] attachments_dir=u'/Volumes/My Passport/Data/GoogleDrive/paper'
10:39:24 workflow.py:1695 DEBUG loading cached data: /Users/student-t/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/net.deanishe.alfred.zothero/__workflow_latest_version.cpickle
10:39:24 workflow.py:2254 DEBUG set last run version: 1.3.0
10:39:24 workflow.py:2103 DEBUG ---------- finished in 0.033s ----------
[10:39:24.588] ZotHero[Script Filter] {"items": [{"autocomplete": "workflow:update", "valid": false, "subtitle": "\u21a9 or \u21e5 to force update check", "icon": {"path": "icons/update-ok.png"}, "title": "Workflow is Up To Date"}, {"variables": {"action": "choose-style", "varname": "CITE_STYLE", "style": ""}, "valid": true, "subtitle": "\u21a9 to change style", "icon": {"path": "icons/off.png"}, "title": "Default Style: None"}, {"variables": {"action": "choose-locale", "varname": "LOCALE"}, "valid": true, "subtitle": "\u21a9 to change locale", "icon": {"path": "icons/locale.png"}, "title": "Locale: Default (US English)"}, {"variables": {"action": "reload"}, "valid": true, "subtitle": "Re-read your Zotero database", "icon": {"path": "icons/reload.png"}, "title": "Reload Zotero Data"}, {"autocomplete": "workflow:openlog", "valid": false, "subtitle": "Open workflow log file in default app", "icon": {"path": "icons/log.png"}, "title": "Open Log File"}, {"subtitle": "Open the documentation in your browser", "title": "View Documentation", "variables": {"url": "https://github.com/deanishe/zothero/blob/master/README.md", "action": "open-url"}, "valid": true, "arg": "https://github.com/deanishe/zothero/blob/master/README.md", "icon": {"path": "icons/docs.png"}}, {"subtitle": "Open GitHub issue tracker in your browser", "title": "Report an Issue", "variables": {"url": "https://github.com/deanishe/zothero/issues", "action": "open-url"}, "valid": true, "arg": "https://github.com/deanishe/zothero/issues", "icon": {"path": "icons/issue.png"}}]}

AppKit Dependency

The pasteboard relies on AppKit, which is bundled with Xcode. I tried install PyobjC with the homebrew version of python. But Alfred clears my PATH variable before running the workflow, which ignore the third party python and its modules.

20:26:57 workflow.py:2074 ERROR No module named AppKit Traceback (most recent call last): File "./lib/workflow/workflow.py", line 2067, in run func(self) File "./zh", line 613, in main return do_copy(args['<style>'], entry_id, args['--bibliography']) File "./zh", line 302, in do_copy import pasteboard as pb File "./lib/pasteboard.py", line 14, in <module> from AppKit import NSPasteboard ImportError: No module named AppKit

Attachments directory does not exist after changing attachment directory

Some time ago I changed my attachment directory in Zotero. The old one is not present in any user-facing settings I can find. The new directory obviously works, as I can access all my files, both those within zotero, and those moved to an external directory by ZotFile.

When I try to use ZotHero, I get a"Attachment directory does not exist" error in Alfred, with the name of the old attachment directory.

cant find attachments in query even with filled ATTACHMENTS_DIR

I have set "Linked Attachment Base Directory" in Zotero, and all my attachments can be launched in Zotero directly.
but in ZotHero, only the items with "URL link" and "File" are displayed as owning attachments, what we want is defiantly "File link", but none of the file link attachments is shown on my query.
I have tried to set the ATTACHMENTS_DIR, it makes any difference.
My file links are generated by ZotFile, and my attachments are mainly stored in the subdirectory (or even more "sub") of the "Linked Attachment Base Directory" in Zotero(because I define the subdirectory name as collection path in Zotero with ZotFile)

Thanks for your workflow, I hope my message will help, maybe the issue is related to the paths of file links related to the subfolder?

Markdown/pandoc support

Thanks for this fantastic workflow!

I was wondering whether you would consider adding support for pandoc/markdown style citatations. This way, in addition to copying 'citation' and 'bibliography', there would be an option to copy the 'Citation key' (preferably prefixed by an "@").

There is a different workflow implementing something similar for Bibdesk (https://www.zvi-biener.org/tech-blog/searching-bibdesk-with-alfred), if it is not clear by my description what I am requesting.

Best regards,
Tormod Bøe

Question - any way to insert full bibliography?

Hi! Sorry if this is a dumb question but wondering if there's anyway to generate a full bibliography that compiles all of the individual references that I've inserted into a scrivener file? Thanks!

Problem with loading of the citation

Hey,

I don't know if this is normal or not but or me it takes some time to load the citation into the clipboard. It's kind of strange, everything is fine, i hit command+ enter to copy the citation then I want to fill it in but when I hit command + V it pastes whatever was in my clipboard before. I have to wait 2 seconds or sth like that until it is loaded in the clipboard end then I can paste with command+v.
Is this normal? Is there anything I can do to make it faster? It's not the biggest problem but it breaks my workflow a little bit to wait like this.

But thanks alot for your work, it still is way faster than opening the program.

failing to update in ARM environment

I'm on an M1 mac mini, with the universal build of Alfred. This workflow doesn't work due to update failure. See below for the log:


15:47:18 workflow.py:2338 INFO     checking for update ...
15:47:18 update.py:472 INFO     14 download(s) for deanishe/zothero
15:47:18 update.py:564 ERROR    suffix must start with - :  Universal
Traceback (most recent call last):
  File "./lib/workflow/update.py", line 557, in <module>
    check_update(repo, version, prereleases)
  File "./lib/workflow/update.py", line 474, in check_update
    dl = latest_download(dls, alfred_version, prereleases)
  File "./lib/workflow/update.py", line 420, in latest_download
    version = Version(alfred_version)
  File "./lib/workflow/update.py", line 242, in __init__
    self._parse(vstr)
  File "./lib/workflow/update.py", line 271, in _parse
    'suffix must start with - : ' + suffix)
ValueError: suffix must start with - :  Universal
15:47:18 background.py:285 ERROR    [__workflow_update_check] command failed with status 1
15:47:22 workflow.py:2338 INFO     checking for update ...
15:47:22 update.py:472 INFO     14 download(s) for deanishe/zothero
15:47:22 update.py:564 ERROR    suffix must start with - :  Universal
Traceback (most recent call last):
  File "./lib/workflow/update.py", line 557, in <module>
    check_update(repo, version, prereleases)
  File "./lib/workflow/update.py", line 474, in check_update
    dl = latest_download(dls, alfred_version, prereleases)
  File "./lib/workflow/update.py", line 420, in latest_download
    version = Version(alfred_version)
  File "./lib/workflow/update.py", line 242, in __init__
    self._parse(vstr)
  File "./lib/workflow/update.py", line 271, in _parse
    'suffix must start with - : ' + suffix)
ValueError: suffix must start with - :  Universal
15:47:22 background.py:285 ERROR    [__workflow_update_check] command failed with status 1
15:47:22 workflow.py:2338 INFO     checking for update ...
15:47:22 workflow.py:2338 INFO     checking for update ...
15:47:23 background.py:260 CRITICAL [__workflow_update_check] command cache not found: /Users/zhiyufu/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/net.deanishe.alfred.zothero/__workflow_update_check.argcache
15:47:23 workflow.py:2080 ERROR    [__workflow_update_check] command cache not found: /Users/zhiyufu/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/net.deanishe.alfred.zothero/__workflow_update_check.argcache
Traceback (most recent call last):
  File "/Users/zhiyufu/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.A1B7B70F-F554-4AC7-85C9-0EAFB074FD20/lib/workflow/workflow.py", line 2073, in run
    func(self)
  File "./lib/workflow/background.py", line 261, in main
    raise IOError(msg)
IOError: [__workflow_update_check] command cache not found: /Users/zhiyufu/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/net.deanishe.alfred.zothero/__workflow_update_check.argcache
15:47:23 update.py:472 INFO     14 download(s) for deanishe/zothero
15:47:23 update.py:564 ERROR    suffix must start with - :  Universal
Traceback (most recent call last):
  File "./lib/workflow/update.py", line 557, in <module>
    check_update(repo, version, prereleases)
  File "./lib/workflow/update.py", line 474, in check_update
    dl = latest_download(dls, alfred_version, prereleases)
  File "./lib/workflow/update.py", line 420, in latest_download
    version = Version(alfred_version)
  File "./lib/workflow/update.py", line 242, in __init__
    self._parse(vstr)
  File "./lib/workflow/update.py", line 271, in _parse
    'suffix must start with - : ' + suffix)
ValueError: suffix must start with - :  Universal

How to modify the search reg-ex?

Thanks for making this worklflow!

I'd like to change the way multiple search terms are handled. I'm new to python but I traced my way to the zh script but from there I figured I need to go to the zothero module and find app in it. But I haven't been able to figure out where that module is. Python doesn't seem to know of it. What am I missing? Could you give me a pointer?

In case you are wondering what I want to change: let's say I have a Zotero reference with the title "Quick brown fox". I would want that to be in the search results when I search for qui fo. Currently, quick fo will work, but not quick fo (note the space at the end).

Full text search - within PDF attachments from Alfred. Possible?

Hi there.

Thank you for making this extension!

After starting to use zotero in earnest, I wished this existed, so finding out that this is out in the world made me really happy!

I have one question though - I understand that you can do local full text search of Zotero content by going to "everything" in Zotero, and then searching. I've pasted the relevant section from Zotero below:

Full-text PDF indexing allows embedded text within PDFs to be searched with Quick Search (via the “Everything” option) and Advanced Search (via “Attachment Content”). You can control how much text in a PDF is indexed in the Search pane of Zotero preferences (default: 500000 characters, 100 pages). Indexing happens automatically in the background when Zotero is idle.

Is there a way to search the indexed content of PDFs or similar attachments?

Searches I do in the zotero app when I search 'everything' return results that don't show up when I do an all search in the this plugin, and I'm trying to understand how you'd make them appear.

From a quick look through the code, I found this Index class, but I I'm not familiar enough with Zotero's internals to know how to access the index that zotero itself maintains, to make it accessible in the plugin.

https://github.com/deanishe/zothero/blob/master/src/lib/zothero/index.py

Is it possible to either access the search index maintained by Zotero?

Support for copying Zotero Select URL

Hi, thanks for this great tool!
One of my main use cases for Zotero is linking from other note-taking tools, especially from Markdown - like [citekey](zotero://select/{etc}). I was wondering what a convenient way to use Zothero to copy the Zotero select URL to the keyboard (or, even better, the full link style I wrote above) might look like. It would be ideal to set this as a 'citation style' of its own.

It seems like it might be pretty straightforward, since said URL is already used for the open-in-zotero action. By adding a 'Copy to Clipboard' action that copies {var:url} to one of the existing actions, I can get the URL copied, but this is hacky - I'm just not sure how to do it better.

Unable to copy citations

Thank you for this very useful workflow!

The script generally works but when copying citations there seems to be some issue. I have tried using different styles and the problem persists. When I copy a citation this is what I get as a result
zotero://select/items/1_MEPFRUEK
I am also attaching the portion of the log file when this error occurred.
I am using Catalina 10.15.4 with Alfred Version 4.0.9.

22:45:49 core.py:197 INFO     [core] searching for "o" ...
22:45:49 index.py:245 INFO     [index] 110 result(s) for u'o'
22:45:53 workflow.py:2080 ERROR    database is locked
Traceback (most recent call last):
  File "./lib/workflow/workflow.py", line 2073, in run
    func(self)
  File "./zh", line 714, in main
    return do_reindex()
  File "./zh", line 597, in do_reindex
    app.update_index(force=False)
  File "./lib/zothero/core.py", line 166, in update_index
    self.index.update(self.zotero, force)
  File "./lib/zothero/index.py", line 282, in update
    self._update(zot, True)
  File "./lib/zothero/index.py", line 325, in _update
    for e in it:
  File "./lib/zothero/zotero.py", line 268, in all_entries
    yield self._load_entry(row)
  File "./lib/zothero/zotero.py", line 320, in _load_entry
    e.citekey = self.bbt.citekey('{}_{}'.format(e.library, e.key))
  File "./lib/zothero/zotero.py", line 195, in bbt
    self._bbt = BetterBibTex(self.datadir)
  File "./lib/zothero/betterbibtex.py", line 48, in __init__
    row = conn.execute(SQL).fetchone()
OperationalError: database is locked
22:45:53 workflow.py:2082 INFO     for assistance, see: https://github.com/deanishe/zothero/issues

Down Arrow in Court Field in Jurism Client Not Working

The down arrow in the yellow shaded Court field (and Jurisdiction field) in the Jurism interface suddenly stopped working.
I reinstalled Jurism (did not uninstall old Jurism).
I was improperly attempting to edit some files in my Zotero folder - now know not to do it that way.
Any suggestions.

Expand the copy citation to "Quick Copy"

the open issues are mostly related to the markdown citation.

It seems that ZotHero get citation/bibliography from cpjs.
but Zotero also has a build in function called "Quick Copy", it contains "Export" formats and the "Citation Style" formats.

the "Export" formats contains more such like BetterBibTex citation key, json, csv and so on. which is more broad than CSL export. what's more, it is easily customized, for example https://zoteromusings.wordpress.com/2013/04/23/zotero-item-uris-from-client/.

Quick Copy will directly return bibliography if I choose csl style, I also think copy the citations of csl will be less useful than citation-key.

So, I think remain the bibliography function as it is and expand the citation export to "Quick Copy" will be better.

Just saw this and it made me smile

Just wanted to say that this workflow looks awesome, and it put a smile on my face to think that academics out there will have such an awesome way to work with their citations. I've been out of the Alfred Workflow game for a long time now, but I still respect the hell out of you. And it is cool to see you bring your skills and elegant code to Zotero.

Fails to run with "import cPickle" failed Error.

My /usr/bin/python is aliased to ~/Library/Enthought/Canopy/edm/envs/User/bin/python

~/Library/Enthought/Canopy/edm/envs/User/bin/python --version
Python 3.5.2 -- Enthought, Inc. (x86_64)

When I run the zotero command example zot impact ( I have pdf with title impact of something in zotero), it fails and gives following debug message:

Starting debug for 'ZotHero'

[2018-09-07 11:01:49][ERROR: input.scriptfilter] Code 1: Traceback (most recent call last):
  File "./zh", line 49, in <module>
    from workflow import Workflow3, ICON_WARNING, ICON_WEB
  File "./lib/workflow/__init__.py", line 16, in <module>
    from .workflow import Workflow, manager
  File "./lib/workflow/workflow.py", line 25, in <module>
    import cPickle
ImportError: No module named 'cPickle'
[2018-09-07 11:01:49][ERROR: input.scriptfilter] Code 1: Traceback (most recent call last):
  File "./zh", line 49, in <module>
    from workflow import Workflow3, ICON_WARNING, ICON_WEB
  File "./lib/workflow/__init__.py", line 16, in <module>
    from .workflow import Workflow, manager
  File "./lib/workflow/workflow.py", line 25, in <module>
    import cPickle
ImportError: No module named 'cPickle'
[2018-09-07 11:01:50][ERROR: input.scriptfilter] Code 1: Traceback (most recent call last):
  File "./zh", line 49, in <module>
    from workflow import Workflow3, ICON_WARNING, ICON_WEB
  File "./lib/workflow/__init__.py", line 16, in <module>
    from .workflow import Workflow, manager
  File "./lib/workflow/workflow.py", line 25, in <module>
    import cPickle
ImportError: No module named 'cPickle'
[2018-09-07 11:01:50][ERROR: input.scriptfilter] Code 1: Traceback (most recent call last):
  File "./zh", line 49, in <module>
    from workflow import Workflow3, ICON_WARNING, ICON_WEB
  File "./lib/workflow/__init__.py", line 16, in <module>
    from .workflow import Workflow, manager
  File "./lib/workflow/workflow.py", line 25, in <module>
    import cPickle
ImportError: No module named 'cPickle'

Note that this workflow runs fine in my laptop with pyton2.7 but it fails in office computer with aliased python.

I can not alias python2 to python in office computer.

Is there a way to circumvent this problem?

Database is locked

I meet some error, I cannot search the paper in the zotero

10:33:21 workflow.py:2080 ERROR database is locked
Traceback (most recent call last):
File "./lib/workflow/workflow.py", line 2073, in run
func(self)
File "./zh", line 714, in main
return do_reindex()
File "./zh", line 597, in do_reindex
app.update_index(force=False)
File "./lib/zothero/core.py", line 166, in update_index
self.index.update(self.zotero, force)
File "./lib/zothero/index.py", line 277, in update
if not self._update(zot, force):
File "./lib/zothero/index.py", line 325, in _update
for e in it:
File "./lib/zothero/zotero.py", line 268, in all_entries
yield self._load_entry(row)
File "./lib/zothero/zotero.py", line 320, in load_entry
e.citekey = self.bbt.citekey('{}
{}'.format(e.library, e.key))
File "./lib/zothero/zotero.py", line 195, in bbt
self._bbt = BetterBibTex(self.datadir)
File "./lib/zothero/betterbibtex.py", line 48, in init
row = conn.execute(SQL).fetchone()
OperationalError: database is locked
10:33:22 workflow.py:2082 INFO for assistance, see: https://github.com/deanishe/zothero/issues

Support different database names

For example, the Juris-M fork of Zotero saves its data to ~/Juris-M/jurism.sqlite by default.

The workflow currently supports changing the directory name, but not the database name.

Can ZOTERO_DIR be replaced with DB_PATH? ATTACHMENTS_DIR could possibly be derived from os.path.dirname(DB_PATH) by default.

Cannot copy to clipboard on MacOS catalina

When I try to copy bibliography using the altkey nothing happens. The debug shows and "permission denied" error. I'm on Mac, so I thought that could be caused by the OS. However, Alfred has all necessary permissions.

I don't remember if it has ever worked on this machine, because I only have it for about two months.

BTW, awesome project. Where can I buy you a coffee?


[12:31:21.514] ZotHero[Script Filter] Processing complete
[12:31:21.515] ZotHero[Script Filter] Passing output '1403' to Debug
[12:31:21.516] ZotHero[Debug] .
/----------- ZOT OUT -----------\
query=1403
variables={
  action = "copy-citation"
  ATTACHMENTS_DIR = ""
  bibliography = "1"
  CITE_STYLE = "http://www.zotero.org/styles/association-for-computing-machinery"
  citekey = "koelleWhatAcceptableThoughts2019"
  COPY_CITEKEY_MOD = ""
  id = "1403"
  LOCALE = "en-GB"
  style = "http://www.zotero.org/styles/association-for-computing-machinery"
  stylename = "Association for Computing Machinery"
  url = "zotero://select/items/1_W655LZEA"
  ZOTERO_DIR = ""
}
\-------------------------------/
[12:31:21.518] ZotHero[Debug] Processing complete
[12:31:21.519] ZotHero[Debug] Passing output '1403' to Filter
[12:31:21.521] ZotHero[Debug] Passing output '1403' to Filter
[12:31:21.522] ZotHero[Debug] Passing output '1403' to Filter
[12:31:21.523] ZotHero[Debug] Passing output '1403' to Filter
[12:31:21.524] ZotHero[Debug] Passing output '1403' to Filter
[12:31:21.525] ZotHero[Filter] Processing complete
[12:31:21.526] ZotHero[Filter] Passing output '1403' to Call External Trigger
[12:31:21.527] ZotHero[External] Processing complete
[12:31:21.528] ZotHero[External] Passing output '' to Filter
[12:31:21.529] ZotHero[Filter] Processing complete
[12:31:21.530] ZotHero[Filter] Passing output '' to Script Filter
[12:31:21.538] ZotHero[External] Passing output '' to Debug
[12:31:21.540] ZotHero[Debug] .
/------- COPY CITATION IN --------\
query=
variables={
  action = "copy-citation"
  ATTACHMENTS_DIR = ""
  bibliography = "1"
  CITE_STYLE = "http://www.zotero.org/styles/association-for-computing-machinery"
  citekey = "koelleWhatAcceptableThoughts2019"
  COPY_CITEKEY_MOD = ""
  id = "1403"
  LOCALE = "en-GB"
  style = "http://www.zotero.org/styles/association-for-computing-machinery"
  stylename = "Association for Computing Machinery"
  url = "zotero://select/items/1_W655LZEA"
  ZOTERO_DIR = ""
}
\---------------------------------/
[12:31:21.543] ZotHero[Debug] Processing complete
[12:31:21.544] ZotHero[Debug] Passing output '' to Hide Alfred
[12:31:21.556] ZotHero[Hide Alfred] Processing complete
[12:31:21.558] ZotHero[Hide Alfred] Passing output '' to Run Script
[12:31:21.560] ZotHero[Script Filter] Queuing argument ''
[12:31:21.632] ZotHero[Script Filter] Script with argv '' finished
[12:31:21.641] ZotHero[Script Filter] {
	"items": [
		{
			"title": "Generating Citation…",
			"subtitle": "This window will disappear when your citation is on the pasteboard",
			"icon": {
				"path": "icons/reload.png"
			},
			"valid": false
		}
	]
}

[12:31:22.136] STDERR: ZotHero[Run Script] .
12:31:21 workflow.py:2061 DEBUG    ---------- ZotHero (1.3.0) ----------
12:31:21 workflow.py:1468 DEBUG    reading settings from /Users/eppf1/Library/Application Support/Alfred/Workflow Data/net.deanishe.alfred.zothero/settings.json
12:31:21 workflow.py:2343 DEBUG    update check not due
12:31:21 zh:667 DEBUG    args={'--bibliography': True,
 '--help': False,
 '--paste': False,
 '--style': None,
 '--text': None,
 '--title': None,
 '<citekey>': None,
 '<id>': u'1403',
 '<key>': None,
 '<query>': None,
 '<style>': u'http://www.zotero.org/styles/association-for-computing-machinery',
 '<value>': None,
 'attachments': False,
 'citations': False,
 'clear': False,
 'config': False,
 'copy': True,
 'fields': False,
 'locale': False,
 'notify': False,
 'reindex': False,
 'search': False,
 'setvar': False,
 'style': False}
12:31:21 config.py:88 DEBUG    [config] attachdir=u'/Users/eppf1/OneDrive - Aalto University/PhD/ZoteroFiles'
12:31:21 config.py:85 DEBUG    [config] datadir=u'/Users/eppf1/Zotero'
12:31:21 core.py:72 DEBUG    [core] cachedir=u'~/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/net.deanishe.alfred.zothero'
12:31:21 core.py:73 DEBUG    [core] zotero_dir=u'~/Zotero'
12:31:21 core.py:74 DEBUG    [core] attachments_dir=u'~/OneDrive - Aalto University/PhD/ZoteroFiles'
12:31:22 index.py:153 DEBUG    [index] opened u'~/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/net.deanishe.alfred.zothero/search.sqlite'
12:31:22 core.py:133 DEBUG    [core] storage=u'~/Zotero/storage'
12:31:22 core.py:134 DEBUG    [core] styles=u'~/Zotero/styles'
12:31:22 cache.py:311 DEBUG    [cache] opening store 'styles'...
12:31:22 cache.py:311 DEBUG    [cache] opening store 'modtimes'...
12:31:22 styles.py:219 DEBUG    [styles] locale=u'en-GB'
12:31:22 styles.py:220 DEBUG    [styles] style=CSLStyle(name=u'Association for Computing Machinery', path=u'/Users/eppf1/Zotero/styles/association-for-computing-machinery.csl')
12:31:22 styles.py:221 DEBUG    [styles] csl={u'volume': u'26', u'DOI': u'10.1145/3319073', u'shortTitle': u'What is (un)acceptable?', u'language': u'en', u'author': [{'given': u'Marion', 'family': u'Koelle'}, {'given': u'Thomas', 'family': u'Olsson'}, {'given': u'Robb', 'family': u'Mitchell'}, {'given': u'Julie', 'family': u'Williamson'}, {'given': u'Susanne', 'family': u'Boll'}], u'URL': u'http://dl.acm.org/citation.cfm?doid=3328418.3319073', u'issued': {'date-parts': [[2019, 4, 23]]}, u'title': u'What is (un)acceptable?: thoughts on social acceptability in HCI research', u'page': u'36-40', u'ISSN': u'10725520', u'source': u'DOI.org (Crossref)', u'issue': u'3', u'container-title': u'Interactions', u'accessed': {'date-parts': [[2019, 9, 5]]}, u'journalAbbreviation': u'Interactions', 'type': u'article-journal', 'id': u'W655LZEA'}
12:31:22 cite.py:47 DEBUG    [cite] cmd=['./lib/cite/cite', '--verbose', '--locale-dir', './lib/cite/locales', '--bibliography', '--locale', u'en-GB', u'/Users/eppf1/Zotero/styles/association-for-computing-machinery.csl', '/var/folders/4t/6w5qtn213kb75nh71b5kgv3m0000gn/T/tmpMYl9MJ.json']
12:31:22 workflow.py:2080 ERROR    [Errno 13] Permission denied
Traceback (most recent call last):
  File "./lib/workflow/workflow.py", line 2073, in run
    func(self)
  File "./zh", line 702, in main
    args['--paste'])
  File "./zh", line 352, in do_copy
    data = app.styles.cite(e, s, bib_style, LOCALE)
  File "./lib/zothero/styles.py", line 224, in cite
    return cite.generate(entry.csl, style.path, bibliography, locale)
  File "./lib/cite/cite.py", line 50, in generate
    stderr=subprocess.PIPE)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 13] Permission denied
12:31:22 workflow.py:2082 INFO     for assistance, see: https://github.com/deanishe/zothero/issues
12:31:22 workflow.py:2103 DEBUG    ---------- finished in 0.396s ----------

initializing search index never finishes

zothero worked fine until I installed the new update. Now it gives the "initializing search index" message whenever I try a search and it never gets past this message. I tried putting the explicit path to my zotero data (I used the default, but in any case), but that didn't solve the problem.

Back functionality to return to list of search results

Zothero is awesome, thanks a lot for it! The recently added feature to copy the BibTeX key is awesome and further facilitated my workflow. Thank you very much—great work!

A feature I am still missing yet is a kind of "go back" functionality. For example, after typing zot <name of paper> I choose the desired paper and switch into its attachments by pressing ⇧+⌅. Usually, I then use Alfred's integrated QuickLook feature by pressing ⇧ to take a look into the PDF before opening it in my PDF viewer. Sometimes, I notice that I have chosen the wrong entry and thus want to go back to the list of search results. I could not find any way to accomplish that. Is that supported somehow, just a missing feature, or generally not intended by Alfred's workflow design?

How to copy the bibliography?

Hi, thanks for the amazing workflow.

I often write paper in Latex format, so it will be much better if I can copy the bibliography from the workflows. But I can't find any way in the README.

Do you have any way to do this? Thanks very much.

"No matches found" for new added items

ZotHero can not find some items, especially the new added items.
This is the situation even if I rebuilt the index in Zotero:
image
image
image
(I changed the key from 'zot' to 'z')

Remove Alfred dependency (cross platform)

Very good job with Zothero! I would love to see a similar tools replacing the default Zotero picker.

How hard would it be to to not use Alfred and make a cross platform selector? I read your Python code, as I understand Alfred is "only" used for the UX.

Also I'm not sure that directly connecting to the DB is the best way. Instead it's possible to use the Zotero API to query the library (but then the Zotero need to be launched).

I'm think of somethings like http://support.readcube.com/support/solutions/articles/30000024001-magic-citations-on-papers-3-for-mac

citations - select first author

The papers 3's magic citation is not only limited to cite, but can also transform the citekey in citation (in any text editor).
citations - format manuscript

Scannable Cite

Hi!

I'm using Scannable Cite in my work, but it seems it is not loaded in the list of citation formats in ZotHero. I see the RTF scan is there, which is good, but Scannable Cite is more stable and powerful, and popular among researchers.

Any way to make it visible in citation style chooser?

https://zotero-odf-scan.github.io/zotero-odf-scan/

copying Better BibTex citekey

While attempting to copy a Better BibTex citekey an error is raised. I have set COPY_CITEKEY_MOD differently (fn, cmd, ctrl) to check, but find the same result.

This is the error from the log:

13:11:27 workflow.py:2080 ERROR    'NoneType' object has no attribute 'tags'
Traceback (most recent call last):
  File "./lib/workflow/workflow.py", line 2073, in run
    func(self)
  File "./zh", line 714, in main
    return do_reindex()
  File "./zh", line 597, in do_reindex
    app.update_index(force=False)
  File "./lib/zothero/core.py", line 166, in update_index
    self.index.update(self.zotero, force)
  File "./lib/zothero/index.py", line 277, in update
    if not self._update(zot, force):
  File "./lib/zothero/index.py", line 327, in _update
    tags = u' '.join(e.tags)

The Alfred window shows "Open in Zotero" when using the chosen key.

How to make ⌘↩ (copy citation) and ⌥↩ (copy bibliography) use different citation styles?

I'd like to have ⌘↩ (copy citation) use the RTF Scan citation style, and ⌥↩ (copy bibliography) use the Chicago note citation style. However, it seems like I can only make them both use one or the other.

The configuration instructions explain how to change the default, but don't explain how to make them use different defaults. The two methods in the configuration instructions both do the same thing: set the default style. But the default is always set for both, so they always produce the same text.

Would you please explain how to make the default style for ⌘↩ different from the default for ⌥↩?

Juris-M Support

I use Juris-M, a variant of Zotero, to manage my bibliography. Its database is structured just like Zotero's, but it's stored at ~/Juris-M as jurism.sqlite. I tried updating ZOTERO_DIR to ~/Juris-M, but it appears that ZotHero still tries to look for zotero.sqlite there. How do I make it look for jurism.sqlite instead?

Thanks in advance for your help!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.