Bookends Tools, an Alfred workflow of 11 different functions

Users asking other users for AppleScripts that work with Bookends.
iandol
Posts: 336
Joined: Fri Jan 25, 2008 2:31 pm

Re: Bookends Tools, an Alfred workflow of 11 different functions

Post by iandol »

I've updated this to V1.2.1 — I rewrote the becite / betitle / bebib tools in Ruby to be much faster and allow multiple author/word searching and refining the search with a year (e.g. friston hobson 2014 will find papers authored or edited by friston and hobson in 2014 within Alfred). Because the Ruby code is so much faster I also added a new keyword too beall to search all fields for multiple words with optional date. The becite / betitle / bebib / beall tools now accept ⇧ to open the selected reference back in Bookends.
Last edited by iandol on Thu Apr 26, 2018 6:07 am, edited 1 time in total.

fb3
Posts: 14
Joined: Tue Jan 09, 2018 8:23 am

Re: Bookends Tools, an Alfred workflow of 11 different functions

Post by fb3 »

Hi.

Will test this in the next days.. busy atm

Thanks for improving on these workflows!

taja
Posts: 41
Joined: Sun Feb 12, 2012 10:39 pm

Re: Bookends Tools, an Alfred workflow of 11 different functions

Post by taja »

Just wanted to pipe up and say that these workflows are fantastic.

iandol
Posts: 336
Joined: Fri Jan 25, 2008 2:31 pm

Re: Bookends Tools, an Alfred workflow of 11 different functions

Post by iandol »

V1.2.2 released, with only a small fix for the new API of the Scopus Search tool...

iandol
Posts: 336
Joined: Fri Jan 25, 2008 2:31 pm

Re: Bookends Tools, an Alfred workflow of 11 different functions

Post by iandol »

Just released V1.2.4 — becite/betitle/beall now shows if a reference has an attachment, and for Bookends 13.x users use the new applescript JSON events that are slightly more efficient (the older code is used for BE12 users). V1.2.3 added use of the [fn] key to open the attachment directly, which is more useful now you can see which refs have attachments!
Screen Shot 2018-05-16 at 18.24.16_SMALL.png
Screen Shot 2018-05-16 at 18.24.16_SMALL.png (65.52 KiB) Viewed 9740 times

iandol
Posts: 336
Joined: Fri Jan 25, 2008 2:31 pm

Re: Bookends Tools, an Alfred workflow of 11 different functions

Post by iandol »

I've just released V1.2.5, which presents the first AND last author names with initials to provide a bit more context for the search results.
Image

And inspired by Jon's point about using quicklook in a potential native search system, I realised that I can get Quicklook for attachments working in Alfred. This is really cool: so you search, focus a results item with an attachment (denoted by the 📎) then press [shift] or [⌘][Y] and you can quicklook the PDF directly without Alfred losing focus so you can check the paper before inserting the citation. You must enter your attachments path in the workflow attachmentsFolder variable otherwise Quicklook will not work.

https://github.com/iandol/bookends-tool ... tag/V1.2.5
Last edited by iandol on Sun Jul 22, 2018 5:59 am, edited 1 time in total.


iandol
Posts: 336
Joined: Fri Jan 25, 2008 2:31 pm

Re: Bookends Tools, an Alfred workflow of 11 different functions

Post by iandol »

Updated to V1.2.8 which adds phrase search:

https://github.com/iandol/bookends-tool ... tag/V1.2.8

Image

Also just to remind you, if you want Quicklook to work, you should change the attachmentsFolder variable to point to your Bookends attachments path. All PDfs should be in the same folder, as it would be too slow to try to find the path automatically…

Citelalb
Posts: 2
Joined: Wed Jul 25, 2018 6:18 am

Re: Bookends Tools, an Alfred workflow of 11 different functions

Post by Citelalb »

This works all works really well. Thank you for this for this nice workflow. Is there a way to get the attachments preview to work having multiple attachments per reference?

iandol
Posts: 336
Joined: Fri Jan 25, 2008 2:31 pm

Re: Bookends Tools, an Alfred workflow of 11 different functions

Post by iandol »

Yes, at the moment it can only quicklook one of the attachments unfortunately, I simply select the first one that Bookends returns. QL does handle multiple files, and I will ask on the Alfred forums and see if there is a trick to pass N > 1 files via Alfred to QL 8)

iandol
Posts: 336
Joined: Fri Jan 25, 2008 2:31 pm

Re: Bookends Tools, an Alfred workflow of 11 different functions

Post by iandol »

V1.2.9 is released:
  • add a new workflow variable tempCitationStyle that sets the default temporary citation format for becite / betitle / beall. When unset it will be the Bookends standard {author,year,#id}, but you can set the variable to Pandoc / MMD / LaTeX to paste the citation in a different format ([@key] / [#key] / \cite[]{key}).
  • If the authors field is empty for a reference, we now try to use editor names instead in the Alfred results list.
Regarding multiple attachments, I’ve made a wishlist post on the Alfred forums asking for multiple file QL support: https://github.com/iandol/bookends-tools/issues/5

Citelalb
Posts: 2
Joined: Wed Jul 25, 2018 6:18 am

Re: Bookends Tools, an Alfred workflow of 11 different functions

Post by Citelalb »

Sorry for my late response and thank you for another great update with the useful addition 'tempCitationStyle'. This is a great improvement.
Regarding my previous question: My problem was that for some references the preview didn't work, I just saw the filenames and not the preview of the pdf. Coincidentally, the references where the preview of the corresponding attachments didn't work had multiple attachments. Hence, I concluded that the issue is caused by references with multiple references. Now it turned out that the problem is something else. It seems to be a problem with the filenames. E.g., a file that contains '/' can't be previewd. When I remove the '/' of the filename the preview works. As I think your attachments preview is fantastic, I'm thinking of a global rename scheme of my PDFs. As of now, many of the filenames of my attachments contain special characters as they include manuscript titles. Any suggestion for a good strategy to organize the attachments and attchment filenames?

iandol
Posts: 336
Joined: Fri Jan 25, 2008 2:31 pm

Re: Bookends Tools, an Alfred workflow of 11 different functions

Post by iandol »

I’ve just updated this to V1.3.3.

https://github.com/iandol/bookends-tool ... tag/V1.3.3

This makes some changes in the Scopus search tool, bescopus:
  • Update the Applescript interface used to control Bookends to use the new events system that is faster.
  • Better error checking when fetching the scopus API data, and working round an annoying Ruby error when the system proxy is set.
  • Added a new environment variable scopusBaseURL to specify a replacement base url prefix, if for e.g. you access Scopus through a proxy. For example, the default address is https://www.scopus.com/ but my institution accesses through https://www-scopus-com-443.webvpn.las.ac.cn/ so I set that and URLs get rewritten to use the new base URL.
Another small change, Alfred now tells you directly how many citations the selected reference has:
Screenshot 2020-05-21 at 10.58.40_SMALL.png
Screenshot 2020-05-21 at 10.58.40_SMALL.png (92.35 KiB) Viewed 1848 times
As this tool is a command-line script, you can also integrate it into other workflows if you need:

viewtopic.php?f=6&t=4362&p=19762&hilit=scopus#p19762
https://github.com/iandol/bookends-tool ... opusSearch

Cassady
Posts: 167
Joined: Thu Aug 22, 2013 3:48 pm
Location: Sqornshellous

Re: Bookends Tools, an Alfred workflow of 11 different functions

Post by Cassady »

Thank you so much for working so actively on this! Much appreciated!

iandol
Posts: 336
Joined: Fri Jan 25, 2008 2:31 pm

Re: Bookends Tools, an Alfred workflow of 11 different functions

Post by iandol »

V1.3.4 released:

Changes:
A few releases back (~V13.2), Bookends added a dedicated Quick Add Applescript command. I couldn't get it to work in the background at the time and continued to use GUI scripting. Thanks to a hint from @bcdavasconcelos I realised it was a problem in my code, and this works fine in the background, so I upgraded bequickadd to use this more efficient and reliable command method.

Also a fix for betobibtex, if there is a parsing error when pandoc-citeproc tries to convert the BibTeX output to JSON, the user will be warned with a display notification and the BibTeX will not be deleted so the user can check it.

https://github.com/iandol/bookends-tool ... tag/V1.3.4

Post Reply