• Stars
    star
    477
  • Rank 92,112 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created about 7 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Rapidly search and cite Zotero entries from Alfred

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.

More Repositories

1

alfred-workflow

Full-featured library for writing Alfred 3 & 4 workflows
Python
2,970
star
2

awgo

Go library for Alfred 3 + 4 workflows
Go
859
star
3

alfred-convert

Convert between different units in Alfred
Python
721
star
4

alfred-stackexchange

Search StackOverflow.com from Alfred
Python
434
star
5

alfred-fixum

Fix Alfred 3 Python workflows affected by the Sierra/Alfred-Workflow background process bug
Python
369
star
6

alfred-ssh

Open SSH/SFTP/mosh connections from Alfred 3+
Go
356
star
7

alfred-firefox

Search and control Firefox from Alfred
Go
342
star
8

alfred-repos

Browse, search and open Git repositories in Alfred
Python
313
star
9

alfred-searchio

Alfred workflow to auto-suggest search results from multiple search engines and languages.
HTML
306
star
10

alfred-pwgen

Generate passwords with Alfred
Python
290
star
11

alfred-fakeum

Generate fake test data in Alfred
Python
288
star
12

alfred-gcal

View Google Calendar events in Alfred
Go
222
star
13

alfred-reddit

Browse Reddit from Alfred
Python
214
star
14

alfred-safari-assistant

Alfred 3+ workflow to search and use Safari bookmarks, history, reading list and tabs.
Go
190
star
15

alfred-vpn-manager

Manage Tunnelblick & Viscosity VPN connections from Alfred
Python
154
star
16

alfred-smartfolders

Quick access to your Smart Folders (Saved Searches) from Alfred
Python
119
star
17

alfred-fuzzy

Fuzzy search helper for Alfred 3+ workflows
Python
93
star
18

alfred-appscripts

Alfred workflow to search and run/open AppleScripts for the active application
Python
87
star
19

alfred-sublime-text

Filter and open your Sublime Text (2 and 3) project files from Alfred.
Go
73
star
20

i-sheet-you-not

Automagically turn Excel spreadsheets into Alfred 3 Workflows
Python
67
star
21

alfred-mailto

Send emails to recipients and groups from Alfred
Python
64
star
22

alfred-fuzzyfolders

Fuzzy search across folder subdirectories
Python
57
star
23

alfred-unicode

Preview Unicode characters and emoji in Alfred
Go
57
star
24

alfred-booksearch

Search Goodreads.com from Alfred
Go
56
star
25

alfred-similar-image-search

Google Image searches based on local files via Alfred
Python
50
star
26

alfred-packal-search

Search Packal.org's collection of Alfred workflows from Alfred
Python
43
star
27

alfred-services

Run macOS services from Alfred
Go
39
star
28

go-safari

Access Safari bookmarks, reading list, history and tabs (macOS)
Go
38
star
29

alfred-relative-dates

Alfred workflow to generate relative dates in different locales
Python
35
star
30

alfred-network-location

List, filter and activate network locations from within Alfred
Python
32
star
31

alfred-duden

Search the duden.de German dictionary from Alfred. With auto-suggest.
Python
32
star
32

alfred-index-demo

Demonstration of using sqlite as a search index in Alfred
Python
26
star
33

alfred-default-folder-x

Access your Default Folder X favourites and recent items in Alfred
Python
25
star
34

alfred-forklift

Filter ForkLift favourites in Alfred
Go
23
star
35

alfred-resolve-url

Alfred workflow to resolve HTTP redirects and return the canonical URL
Python
14
star
36

alfred-gifs

Say it with GIFs (and Alfred)
Python
12
star
37

bundler-icon-server

Generate PNG icons from icon fonts like Font Awesome
HTML
12
star
38

go-env

Access environment variables & populate structs from them
Go
11
star
39

alfred-errnum

Search macOS errors in Alfred 3
Python
10
star
40

alfred-mpd

Control mpd music player from Alfred 3
Python
9
star
41

go-fuzzy

Fuzzy matching & sorting for Go
Go
9
star
42

alfred-glosbe

Translate in Alfred using Glosbe.com
Python
8
star
43

CopyLink.mmBundle

MailMate Command to copy a link to the currently selected email
Python
8
star
44

alfred-transmit

Rapidly search Transmit favourites in Alfred
Go
5
star
45

alfred-bundler-python-demo

Demo Workflow showing how to use the Alfred Bundler in Python
Python
5
star
46

cookiecutter-alfred-workflow

cookiecutter template for Alfred 2 workflows
Python
4
star
47

alfred-star-ratings

Add star ratings to your files on OS X with Alfred
Python
4
star
48

alfred-excel-demo

Demo workflow showing how to use an Excel file as a data source for an Alfred Script Filter
Python
4
star
49

alfred-reminders-demo

Goto lists in Reminders.app
Python
3
star
50

bundler-icon-server-iconpacks

Icon packs for Bundler Icon Server
2
star
51

alfred-subdir-search

Alfred 2 Workflow to search subdirectories
Python
2
star
52

alfred-flixsearch

Search FlixSearch.io from Alfred 2
Python
2
star
53

www.deanishe.net

Hugo static site source
Go
1
star
54

just-a-test

Test Repo for GH API
1
star
55

alfred-workflow-dummy

A dummy repo for testing Alfred-Workflow's update functionality
Python
1
star
56

deanishe.github.io

Generated contents of www.deanishe.net
HTML
1
star