Jump to content
iandol

Bookends Tools — A curated toolset for Bookends reference manager

Recommended Posts

@vitor — thanks for the confirmation, and the excellent updater!

 

@Cassady — I'm a bit confused, BE Tools already uses OneUpdater, the settings appear correct and all 11 tools are connected to it. So it should not need any manual configuration, but be triggered when any tool executes.

 

 

Share this post


Link to post
Posted (edited)
13 minutes ago, iandol said:

 

@Cassady — I'm a bit confused, BE Tools already uses OneUpdater, the settings appear correct and all 11 tools are connected to it. So it should not need any manual configuration, but be triggered when any tool executes.

 

 

 

Wait, what??! ?

 

Wow. I just maximised the Alfred editor, and saw the OneUpdater node, top-left. 

Clearly, I was the confused one!

 

I clearly didn't read properly, and thought the user needed to add the node, should they prefer. 

Gah!

 

That said, somewhere, something isn't working as it should.

The workflow is still sitting on version 1.2.4, which is why I tried to drop in OneUpdater in the first place (after seeing that new versions had dropped), thinking it would then do the updates.

 

Regardless, I have disabled my node now, and will wait and see if it triggers as it was initially intended to [I have dropped the 'frequency' down to "0", just to test].

 

Thanks for the clarification, and apologies for introducing some confusion into the mix! ?  

Edited by Cassady

Share this post


Link to post

@iandol I'm afraid I get another error with 1.2.6 when using beall. Here's what ocmes up:

[2018-07-11 17:02:06][ERROR: input.scriptfilter] Code 1: /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.16824124-417E-42A2-BC67-A5CA41BCFCAD/findReferencesAll.rb:215:in `processAuthor': undefined method `chomp' for nil:NilClass (NoMethodError)
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.16824124-417E-42A2-BC67-A5CA41BCFCAD/findReferencesAll.rb:198:in `parseAuthors'
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.16824124-417E-42A2-BC67-A5CA41BCFCAD/findReferencesAll.rb:85:in `block in getRecords'
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.16824124-417E-42A2-BC67-A5CA41BCFCAD/findReferencesAll.rb:81:in `each'
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.16824124-417E-42A2-BC67-A5CA41BCFCAD/findReferencesAll.rb:81:in `each_with_index'
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.16824124-417E-42A2-BC67-A5CA41BCFCAD/findReferencesAll.rb:81:in `getRecords'
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.16824124-417E-42A2-BC67-A5CA41BCFCAD/findReferencesAll.rb:227:in `doSearch'
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.16824124-417E-42A2-BC67-A5CA41BCFCAD/findReferencesAll.rb:254:in `<main>'
[2018-07-11 17:02:07][ERROR: input.scriptfilter] Code 1: /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.16824124-417E-42A2-BC67-A5CA41BCFCAD/findReferencesAll.rb:215:in `processAuthor': undefined method `chomp' for nil:NilClass (NoMethodError)
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.16824124-417E-42A2-BC67-A5CA41BCFCAD/findReferencesAll.rb:198:in `parseAuthors'
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.16824124-417E-42A2-BC67-A5CA41BCFCAD/findReferencesAll.rb:85:in `block in getRecords'
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.16824124-417E-42A2-BC67-A5CA41BCFCAD/findReferencesAll.rb:81:in `each'
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.16824124-417E-42A2-BC67-A5CA41BCFCAD/findReferencesAll.rb:81:in `each_with_index'
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.16824124-417E-42A2-BC67-A5CA41BCFCAD/findReferencesAll.rb:81:in `getRecords'
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.16824124-417E-42A2-BC67-A5CA41BCFCAD/findReferencesAll.rb:227:in `doSearch'
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.16824124-417E-42A2-BC67-A5CA41BCFCAD/findReferencesAll.rb:254:in `<main>'

Share this post


Link to post

@taja — ok, the new author parsing didn't handle empty author fields, this wasn't an issue for becite, but was for beall. For the next release I should retrieve both authors and editors, and use editors if authors is empty, but I don't have time to do that for now, so author becomes "Unknown"...

 

V1.2.7 released, please retest and let me know how it goes.

Share this post


Link to post

@iandol Hi - just tested beall and betitle on 1.2.7 and it works *except* when I search for one term that should return a very large number of results (for reference, when I type it into search field in Bookends it returns nearly 3000 results). Neither beall nor betitle return any results when searching for it. I don't know if the problem relates to the sheer number of results. This might be a bit of an edge case, because beall works fine in all other cases, e.g.:

2018-07-12 09:46:21][trigger.hotkey] Processing output of 'input.scriptfilter' with arg ''
[2018-07-12 09:46:23][input.scriptfilter] Queuing argument 'adcock'
[2018-07-12 09:46:24][input.scriptfilter] Script with argument 'adcock' finished
[2018-07-12 09:46:24][input.scriptfilter] {"comment":"NAMES=adcock | YEAR= | SQL=(allFields REGEX '(?i)adcock')","items":[{"uid":"9203","arg":"9203","title":"Unknown  (2007)","subtitle":"Modern Political Science: Anglo-American Exchanges Since 1880","icon":{"path":"file.png"}},{"uid":"86192","arg":"86192","title":"Adcock R  (2007)","subtitle":"Interpreting Behaviouralism","icon":{"path":"file.png"}},{"uid":"57741","arg":"57741","title":"Adcock R & Bevir M  (2007)","subtitle":"The Remaking of Political Theory","icon":{"path":"file.png"}},{"uid":"24715","arg":"24715","title":"Ball T  (2007)","subtitle":"An Ambivalent Alliance: Political Science and American Democracy","icon":{"path":"file.png"}}],"length":4}


However, when I search for a term that should yield a very very high number of results:


beall:

[2018-07-12 09:33:59][ERROR: input.scriptfilter] Code 1: /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5761D1A7-6E32-41AB-9C99-22930F789ECE/findReferencesAll.rb:216:in `processAuthor': undefined method `chomp' for nil:NilClass (NoMethodError)
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5761D1A7-6E32-41AB-9C99-22930F789ECE/findReferencesAll.rb:199:in `parseAuthors'
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5761D1A7-6E32-41AB-9C99-22930F789ECE/findReferencesAll.rb:85:in `block in getRecords'
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5761D1A7-6E32-41AB-9C99-22930F789ECE/findReferencesAll.rb:81:in `each'
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5761D1A7-6E32-41AB-9C99-22930F789ECE/findReferencesAll.rb:81:in `each_with_index'
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5761D1A7-6E32-41AB-9C99-22930F789ECE/findReferencesAll.rb:81:in `getRecords'
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5761D1A7-6E32-41AB-9C99-22930F789ECE/findReferencesAll.rb:228:in `doSearch'
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5761D1A7-6E32-41AB-9C99-22930F789ECE/findReferencesAll.rb:255:in `<main>'

betitle:

[2018-07-12 09:41:51][ERROR: input.scriptfilter] Code 1: /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5761D1A7-6E32-41AB-9C99-22930F789ECE/findReferencesTitle.rb:216:in `processAuthor': undefined method `chomp' for nil:NilClass (NoMethodError)
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5761D1A7-6E32-41AB-9C99-22930F789ECE/findReferencesTitle.rb:199:in `parseAuthors'
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5761D1A7-6E32-41AB-9C99-22930F789ECE/findReferencesTitle.rb:85:in `block in getRecords'
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5761D1A7-6E32-41AB-9C99-22930F789ECE/findReferencesTitle.rb:81:in `each'
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5761D1A7-6E32-41AB-9C99-22930F789ECE/findReferencesTitle.rb:81:in `each_with_index'
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5761D1A7-6E32-41AB-9C99-22930F789ECE/findReferencesTitle.rb:81:in `getRecords'
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5761D1A7-6E32-41AB-9C99-22930F789ECE/findReferencesTitle.rb:228:in `doSearch'
    from /Users/Was/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5761D1A7-6E32-41AB-9C99-22930F789ECE/findReferencesTitle.rb:255:in `<main>'

 

Share this post


Link to post
Posted (edited)

@taja — does V1.2.5 handle the large results list? I've not tested with such a large number, but the error you show is the same as previously, and it doesn't make too much sense. It occurs when processing the author initial, but I've tested authors who have a comma after the family name but no first name or initials and it should work. I've added more defensive checks to try to not trigger this error. Please download the updated script manually and run it from the command line for testing or you can replace the version in your installed workflow:

 

https://github.com/iandol/bookends-tools/blob/master/source/findReferencesAll.rb 

 

Let me know if it works, I don't think this is to do with lots of results, but references that have mangled author names or something, and that large search is revealing the issue...

Edited by iandol

Share this post


Link to post
Posted (edited)

@taja Hi - sorry for taking a while. I replaced the script in my copy of 1.2.7 with the one you just provided and it works!

Edited by taja

Share this post


Link to post
Posted (edited)

Updated to V1.2.8 which adds phrase search delimited by single quotation marks (without quoting words are searched in any location/order):

 

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

 

43035829-669f857a-8d28-11e8-9fc6-18a6557

 

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… 

Edited by iandol

Share this post


Link to post

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, 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.

Share this post


Link to post

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
×