Giter Club home page Giter Club logo

paperpalfred's Introduction

paperpAlfred

Search your Paperpile library with Alfred

Downloads

Setting up paperpAlfred

  1. Download the workflow from Github and double-click to install paperpAlfred

  2. Download your Paperpile library

    • in Paperpile, cogwheel > Settings > Export > Export to JSON

  1. Set the PAPLIBRARY path
  • Copy the library file path to the clipboard

    • In Finder, right-click the file, press option (⌥), the select Copy [FileName] as Pathname
    • Open the 'Configure Workflow' window in paperpAlfred preferences
    • set path to library as the Paperpile Library value
  1. Optional: Set Paperpile Path (Path to Paperpile in Google Drive)

    • this will allow to open PDFs in the system viewer
  2. Optional: change the max number of results returned (default: 99)

    • Set the MAXRESULTS value in the 'Configure Workflow' window in paperpAlfred
    • Set the Key Prefix (citekey prefix) in the 'Configure Workflow' window in paperpAlfred
  3. Optional: Setup hotkeys to launch

    • main search
    • filter by label
    • filter by folder
    • filter by type

Basic Usage

Simple search

  • launch paperpAlfred by typing ppp or using an optional hotkey
  • words or names will be searched across all fields

Filter by label first

  • entering ppl (or optional hotkey) will show a list of labels, the number of items in each label, and the count of item types
  • select the label by pressing return. PaperpAlfred will now search within that label
    • option-return (⌥⏎) will open the label in Paperpile

Filter by folder first

  • entering ppf (or optional hotkey) will show a list of folders, the number of items in each folder, and the count of item types
  • select the folder by pressing return. PaperpAlfred will now search within that folder.
    • option-return (⌥⏎) will open the folder in Paperpile
  • Note: Added feature ✅ the Paperpile web interface does not allow to search by folder

Filter by type first

  • entering ppty will show a list of publication types and the number of items in each
  • select the folder by pressing return. paperpAlfred will now search within that item type
    • shift-return (⇧⏎) will open the folder in Paperpile

Advanced search

  • enter field:, where field is any of the fields below. Example: year:2022
    • title
    • abstract
    • citekey
    • first first author
    • last last author
    • journal
    • folder
    • label
    • pmid
    • year
    • type publication type

Output

  • Alfred returns the top 99 results, numbered. The max number of results returned can be set in Preferences (see Setting up)
  • results are sorted by year (most recent first). Adding --a to the query will invert this order.
  • The main text will return the title.
  • the subtext will return the following:
    • record count/total result count
    • 📜if a PDF is available
    • short ID string (first-last author, journal, year)
    • associated labels

Acting on results

Once the right item is found, the user has seven options to act on it:

  1. return (⏎) will open the PDF in the system viewer (Preview for most users), provided that the PAPPATH has been set (see Setting up). Rarely this might not work (see Known Issues)
  2. shift-return (⇧⏎) will show the abstract and copy it to clipboard
  3. control-return (⌃⏎) will show the complete reference and copy it to the clipboard
  4. option-return (⌥⏎) will copy a short reference (First-last author, journal, year, PMID) to the clipboard
  5. command-return (⌘⏎) will copy the citation key to the clipboard
  6. command-shift-return (⌘⇧⏎) will open the PDF in Google drive
  7. command-option-return (⌘⌥⏎) will open the record in Paperpile

Known Issues

  • incomplete records will not be imported
  • special characters (e.g. ü) will need to be entered in order to match the record
  • File opening is currently using a name search. The Paperpile file naming logic is not entirely clear to me, the folder structure is deprecated and there might be a small number of cases where the PDF might not be retrievable via paperpAlfred. Google drive view should still work in these cases.
  • Currently tested mainly with research papers, reviews etc. There might be untested use cases for other types of publications.
  • label and folder search in the main window (i.e. using label: and folder:) will not be exact matches (e.g. AD will also return GWAS_AD). Match will be exact when starting from folder and label window.

Acknowledgments

  • Dean Jackson for their incredible help on the Alfred mailing list and for creating alfred-index-demo, and other scripts used as templates for this workflow.
  • Jirka from Paperpile for support on the path-to-file issue
  • Alain T, StackExchange user:5237560 (https://nebularena.wordpress.com) for help with a Python script

Changelog

  • 12-04-2022: version 2.1 (Alfred 5)
  • 03-15-2022: version 2.0 (Python3, removed dependencies)
  • 03-17-2021: version 1.0

Feedback

Feedback welcome! If you notice a bug, or have ideas for new features, please feel free to get in touch either here, or on the [Paperpile](https://forum.paperpile.com)/[Alfred](https://www.alfredforum.com) forums.

paperpalfred's People

Contributors

giovannicoppola avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

paperpalfred's Issues

Possibility of using bibtex file instead of JSON?

Since paperpile can auto export library to a bibtex file, I wonder if it is possible to use bibtex as the database? This way the library is always up to date without the need to manually export JSON.
image

Unable to open certain PDF files using system viewer due to file names do not match the actual PDF filename

Thank you for creating this amazing Alfred paperpile plugin. I noticed I am unable to open certain PDF files using system viewer, i.e. after searching for a paper, pressing "Enter" does not do anything.

After some debugging, I found out that the filename extracted from Alfred Workflow (i.e. the query response item 1) does not match the local file name.

The extracted file name from query response contains an additional space (or empty) character after " ..."

So here is the extracted filename:

"Fleming et al. 2018 - Beyond the Trial - Systematic Review of Real-World ... Digital Self-Help Interventions for Depression.pdf"

But my local file name is:

"Fleming et al. 2018 - Beyond the Trial - Systematic Review of Real-World ... Digital Self-Help Interventions for Depression, Low Mood, or Anxiety.pdf"

Notice the first file name contains double space characters after " ...".

At the moment, I did a workaround in the Alfred shell script (open PDF with system viewer) to replace the " ... " with "*" wildcard:

escape_query=echo "{query}" | sed -e "s/ ... / \*/g"
find "$PAPPATH" -name "$escape_query" | head -n 1 | tr \n \0 | xargs -0 open

But would be much appreciated if the future release can incorporate this change?

Publicly sync-ed BibTex file?

Currently some testing of Github automatic export/sync is available and working, would it be possible to have this Workflow point directly to a public Github repo with a sync-ed BibTeX file? Thank you for making this useful Workflow! :)

paperpAlfred not loading new entries in PAPLIBRARY

I recently exported my Paperpile Library to a JSON format multiple times to update my list of papers. Despite this, none of my recent papers appear or are searchable in PaperpAlfred. While the plugin's functionality remains mostly intact, it fails to load any new files. I'm uncertain how to best approach debugging this issue.

Library autoupdate

As far as I understand, paperpAlfred requires manual update of JSON paperpile library and reset the PATH, which is not quite feasible for users.

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.