Jump to content

ZotQuery: an Alfred workflow for Zotero


Recommended Posts

Hi Stephen,

 

I'm happy to be a bug finder. Once I get this working well, I think it will be great. I'm using scrivener to write my thesis, and being able to get the scannable cite quickly is really handy. Below is the bug report for 'z: olden'.  I can usually follow what people are talking about, but I actually know next to no coding, and can't 'really' follow the workflows, or understand anything about the API unfortunately. It is the best I can do to modify a citation style using the mendeley visual editor. I have read your blog post however. When I write z: I really mean z [enter], I sort of thought z: was shorthand for that. I may have misunderstood.  Anyway, as I said, below is the bug report for z [enter] olden, which should show up a single entry I have for olden as creator, plus a few extra such as one where 'golden' is in the title.

 

Also when I find another citation and use either alt or ctrl to export a citation, when I go to scrivener there is nothing on my clipboard. I'll post another bug report for that experience. But first:

 

Starting debug for 'ZotQuery'
 
[ERROR: alfred.workflow.input.scriptfilter] Code 1: 17:33:30 workflow.py:1457 DEBUG    Stored data loaded from : /Users/Damiennew/Library/Application Support/Alfred 2/Workflow Data/com.hackademic.zotquery2/local_zotero.json
17:33:30 workflow.py:1514 DEBUG    Stored data saved at : /Users/Damiennew/Library/Application Support/Alfred 2/Workflow Data/com.hackademic.zotquery2/local_zotero.json
17:33:30 workflow.py:1457 DEBUG    Stored data loaded from : /Users/Damiennew/Library/Application Support/Alfred 2/Workflow Data/com.hackademic.zotquery2/zotquery_backend.json
17:33:30 workflow.py:2150 DEBUG    Got password : com.hackademic.zotquery2:web_zotero
17:33:30 workflow.py:2044 INFO     Checking for update ...
17:33:30 background.py:180 DEBUG    Command arguments cached to `/Users/Damiennew/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.hackademic.zotquery2/__workflow_update_check.argcache`
17:33:30 background.py:184 DEBUG    Calling [u'/usr/bin/python', '/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.803FD61C-8B7B-408C-937D-A6271DE66336/workflow/background.pyc', u'__workflow_update_check'] ...
17:33:30 workflow.py:1903 DEBUG    Workflow finished in 0.003 seconds.
17:33:30 workflow.py:1903 DEBUG    Workflow finished in 0.004 seconds.
17:33:30 background.py:189 DEBUG    Executing task `__workflow_update_check` in background...
17:33:30 zotquery.py:95 INFO     - - - NEW RUN - - -
17:33:30 zotquery.py:106 INFO     Input arguments : [u'search', u'general', u'o']
17:33:30 search.py:255 INFO     Item sqlite query : SELECT key, rank(matchinfo(zotquery)) AS score FROM zotquery WHERE zotquery MATCH 'title:o* OR creators:o* OR collection_title:o* OR date:o* OR tags:o* OR collections:o* OR attachments:o* OR notes:o*' ORDER BY score DESC;
17:33:30 search.py:317 INFO     Connecting to : `folded.db`
17:33:32 search.py:326 INFO     Number of results : 2968
17:33:32 workflow.py:1888 ERROR    string index out of range
Traceback (most recent call last):
  File "/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.803FD61C-8B7B-408C-937D-A6271DE66336/workflow/workflow.py", line 1886, in run
    func(self)
  File "zotquery.py", line 108, in main
    res = pd.run(argv)
  File "zotquery.py", line 64, in run
    return method()
  File "zotquery.py", line 69, in search_codepath
    return search.search(self.flag, self.arg, self.wf)
  File "/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.803FD61C-8B7B-408C-937D-A6271DE66336/zotquery/search.py", line 533, in search
    found_items = search_for_items(scope, query)
  File "/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.803FD61C-8B7B-408C-937D-A6271DE66336/zotquery/search.py", line 266, in search_for_items
    alfred_dict = formatter.prepare_item_feedback()
  File "/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.803FD61C-8B7B-408C-937D-A6271DE66336/zotquery/search.py", line 102, in prepare_item_feedback
    alfred['subtitle'] = self.format_subtitle()
  File "/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.803FD61C-8B7B-408C-937D-A6271DE66336/zotquery/search.py", line 143, in format_subtitle
    subtitle = ' '.join([self.format_creator(),
  File "/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.803FD61C-8B7B-408C-937D-A6271DE66336/zotquery/search.py", line 233, in format_creator
    if not creator_ref[-1] in ('.', '!', '?'):
IndexError: string index out of range
17:33:32 workflow.py:1903 DEBUG    Workflow finished in 1.774 seconds.
[ERROR: alfred.workflow.input.scriptfilter] Code 0: 17:33:32 workflow.py:1457 DEBUG    Stored data loaded from : /Users/Damiennew/Library/Application Support/Alfred 2/Workflow Data/com.hackademic.zotquery2/local_zotero.json
17:33:33 workflow.py:1514 DEBUG    Stored data saved at : /Users/Damiennew/Library/Application Support/Alfred 2/Workflow Data/com.hackademic.zotquery2/local_zotero.json
17:33:33 workflow.py:1457 DEBUG    Stored data loaded from : /Users/Damiennew/Library/Application Support/Alfred 2/Workflow Data/com.hackademic.zotquery2/zotquery_backend.json
17:33:33 workflow.py:2150 DEBUG    Got password : com.hackademic.zotquery2:web_zotero
17:33:33 workflow.py:2044 INFO     Checking for update ...
17:33:33 background.py:180 DEBUG    Command arguments cached to `/Users/Damiennew/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.hackademic.zotquery2/__workflow_update_check.argcache`
17:33:33 background.py:184 DEBUG    Calling [u'/usr/bin/python', '/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.803FD61C-8B7B-408C-937D-A6271DE66336/workflow/background.pyc', u'__workflow_update_check'] ...
17:33:33 workflow.py:1903 DEBUG    Workflow finished in 0.004 seconds.
17:33:33 workflow.py:1903 DEBUG    Workflow finished in 0.003 seconds.
17:33:33 background.py:189 DEBUG    Executing task `__workflow_update_check` in background...
17:33:33 zotquery.py:95 INFO     - - - NEW RUN - - -
17:33:33 zotquery.py:106 INFO     Input arguments : [u'search', u'general', u'olden']
17:33:33 search.py:255 INFO     Item sqlite query : SELECT key, rank(matchinfo(zotquery)) AS score FROM zotquery WHERE zotquery MATCH 'title:olden* OR creators:olden* OR collection_title:olden* OR date:olden* OR tags:olden* OR collections:olden* OR attachments:olden* OR notes:olden*' ORDER BY score DESC;
17:33:33 search.py:317 INFO     Connecting to : `folded.db`
17:33:33 search.py:326 INFO     Number of results : 0
17:33:34 workflow.py:1903 DEBUG    Workflow finished in 0.640 seconds.
 
 
Here is the one for not getting a citation to the clipboard. Alfred initially comes up with a 'string out of range error', then that is replaced by my zotero entries, that doesn't really concern me, though you may like to know about it. Thanks for the great work.
 
Starting debug for 'ZotQuery'
 
[ERROR: alfred.workflow.input.scriptfilter] Code 1: 17:42:27 workflow.py:1457 DEBUG    Stored data loaded from : /Users/Damiennew/Library/Application Support/Alfred 2/Workflow Data/com.hackademic.zotquery2/local_zotero.json
17:42:27 workflow.py:1514 DEBUG    Stored data saved at : /Users/Damiennew/Library/Application Support/Alfred 2/Workflow Data/com.hackademic.zotquery2/local_zotero.json
17:42:27 workflow.py:1457 DEBUG    Stored data loaded from : /Users/Damiennew/Library/Application Support/Alfred 2/Workflow Data/com.hackademic.zotquery2/zotquery_backend.json
17:42:27 workflow.py:2150 DEBUG    Got password : com.hackademic.zotquery2:web_zotero
17:42:27 workflow.py:2044 INFO     Checking for update ...
17:42:27 background.py:180 DEBUG    Command arguments cached to `/Users/Damiennew/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.hackademic.zotquery2/__workflow_update_check.argcache`
17:42:27 background.py:184 DEBUG    Calling [u'/usr/bin/python', '/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.803FD61C-8B7B-408C-937D-A6271DE66336/workflow/background.pyc', u'__workflow_update_check'] ...
17:42:27 workflow.py:1903 DEBUG    Workflow finished in 0.004 seconds.
17:42:27 workflow.py:1903 DEBUG    Workflow finished in 0.003 seconds.
17:42:27 background.py:189 DEBUG    Executing task `__workflow_update_check` in background...
17:42:27 zotquery.py:95 INFO     - - - NEW RUN - - -
17:42:27 zotquery.py:106 INFO     Input arguments : [u'search', u'general', u'a']
17:42:27 search.py:255 INFO     Item sqlite query : SELECT key, rank(matchinfo(zotquery)) AS score FROM zotquery WHERE zotquery MATCH 'title:a* OR creators:a* OR collection_title:a* OR date:a* OR tags:a* OR collections:a* OR attachments:a* OR notes:a*' ORDER BY score DESC;
17:42:27 search.py:317 INFO     Connecting to : `folded.db`
17:42:28 search.py:326 INFO     Number of results : 2371
17:42:29 workflow.py:1888 ERROR    string index out of range
Traceback (most recent call last):
  File "/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.803FD61C-8B7B-408C-937D-A6271DE66336/workflow/workflow.py", line 1886, in run
    func(self)
  File "zotquery.py", line 108, in main
    res = pd.run(argv)
  File "zotquery.py", line 64, in run
    return method()
  File "zotquery.py", line 69, in search_codepath
    return search.search(self.flag, self.arg, self.wf)
  File "/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.803FD61C-8B7B-408C-937D-A6271DE66336/zotquery/search.py", line 533, in search
    found_items = search_for_items(scope, query)
  File "/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.803FD61C-8B7B-408C-937D-A6271DE66336/zotquery/search.py", line 266, in search_for_items
    alfred_dict = formatter.prepare_item_feedback()
  File "/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.803FD61C-8B7B-408C-937D-A6271DE66336/zotquery/search.py", line 102, in prepare_item_feedback
    alfred['subtitle'] = self.format_subtitle()
  File "/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.803FD61C-8B7B-408C-937D-A6271DE66336/zotquery/search.py", line 143, in format_subtitle
    subtitle = ' '.join([self.format_creator(),
  File "/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.803FD61C-8B7B-408C-937D-A6271DE66336/zotquery/search.py", line 233, in format_creator
    if not creator_ref[-1] in ('.', '!', '?'):
IndexError: string index out of range
17:42:29 workflow.py:1903 DEBUG    Workflow finished in 1.444 seconds.
[ERROR: alfred.workflow.input.scriptfilter] Code 0: 17:42:29 workflow.py:1457 DEBUG    Stored data loaded from : /Users/Damiennew/Library/Application Support/Alfred 2/Workflow Data/com.hackademic.zotquery2/local_zotero.json
17:42:29 workflow.py:1514 DEBUG    Stored data saved at : /Users/Damiennew/Library/Application Support/Alfred 2/Workflow Data/com.hackademic.zotquery2/local_zotero.json
17:42:29 workflow.py:1457 DEBUG    Stored data loaded from : /Users/Damiennew/Library/Application Support/Alfred 2/Workflow Data/com.hackademic.zotquery2/zotquery_backend.json
17:42:29 workflow.py:2150 DEBUG    Got password : com.hackademic.zotquery2:web_zotero
17:42:29 workflow.py:2044 INFO     Checking for update ...
17:42:29 background.py:180 DEBUG    Command arguments cached to `/Users/Damiennew/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.hackademic.zotquery2/__workflow_update_check.argcache`
17:42:29 background.py:184 DEBUG    Calling [u'/usr/bin/python', '/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.803FD61C-8B7B-408C-937D-A6271DE66336/workflow/background.pyc', u'__workflow_update_check'] ...
17:42:29 workflow.py:1903 DEBUG    Workflow finished in 0.004 seconds.
17:42:29 workflow.py:1903 DEBUG    Workflow finished in 0.006 seconds.
17:42:29 background.py:189 DEBUG    Executing task `__workflow_update_check` in background...
17:42:29 zotquery.py:95 INFO     - - - NEW RUN - - -
17:42:29 zotquery.py:106 INFO     Input arguments : [u'search', u'general', u'anderson']
17:42:29 search.py:255 INFO     Item sqlite query : SELECT key, rank(matchinfo(zotquery)) AS score FROM zotquery WHERE zotquery MATCH 'title:anderson* OR creators:anderson* OR collection_title:anderson* OR date:anderson* OR tags:anderson* OR collections:anderson* OR attachments:anderson* OR notes:anderson*' ORDER BY score DESC;
17:42:29 search.py:317 INFO     Connecting to : `folded.db`
17:42:29 search.py:326 INFO     Number of results : 14
17:42:30 workflow.py:1903 DEBUG    Workflow finished in 0.706 seconds.
[ERROR: alfred.workflow.action.script] Code 1: 17:42:35 workflow.py:1457 DEBUG    Stored data loaded from : /Users/Damiennew/Library/Application Support/Alfred 2/Workflow Data/com.hackademic.zotquery2/local_zotero.json
17:42:35 workflow.py:1514 DEBUG    Stored data saved at : /Users/Damiennew/Library/Application Support/Alfred 2/Workflow Data/com.hackademic.zotquery2/local_zotero.json
17:42:35 workflow.py:1457 DEBUG    Stored data loaded from : /Users/Damiennew/Library/Application Support/Alfred 2/Workflow Data/com.hackademic.zotquery2/zotquery_backend.json
17:42:35 workflow.py:2150 DEBUG    Got password : com.hackademic.zotquery2:web_zotero
17:42:35 workflow.py:2044 INFO     Checking for update ...
17:42:35 background.py:180 DEBUG    Command arguments cached to `/Users/Damiennew/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.hackademic.zotquery2/__workflow_update_check.argcache`
17:42:35 background.py:184 DEBUG    Calling [u'/usr/bin/python', '/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.803FD61C-8B7B-408C-937D-A6271DE66336/workflow/background.pyc', u'__workflow_update_check'] ...
17:42:35 workflow.py:1903 DEBUG    Workflow finished in 0.004 seconds.
17:42:35 workflow.py:1903 DEBUG    Workflow finished in 0.003 seconds.
17:42:35 background.py:189 DEBUG    Executing task `__workflow_update_check` in background...
17:42:35 zotquery.py:95 INFO     - - - NEW RUN - - -
17:42:35 zotquery.py:106 INFO     Input arguments : [u'export', u'citation', u'0_FCD35TZT']
17:42:37 workflow.py:1888 ERROR    HTTP Error 400: Bad Request
Traceback (most recent call last):
  File "/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.803FD61C-8B7B-408C-937D-A6271DE66336/workflow/workflow.py", line 1886, in run
    func(self)
  File "zotquery.py", line 108, in main
    res = pd.run(argv)
  File "zotquery.py", line 64, in run
    return method()
  File "zotquery.py", line 72, in export_codepath
    return export.export(self.flag, self.arg, self.wf)
  File "/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.803FD61C-8B7B-408C-937D-A6271DE66336/zotquery/export.py", line 23, in export
    cites = get_export_html(flag, uid, wf)
  File "/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.803FD61C-8B7B-408C-937D-A6271DE66336/zotquery/export.py", line 47, in get_export_html
    cites = export_item(flag, uid)
  File "/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.803FD61C-8B7B-408C-937D-A6271DE66336/zotquery/export.py", line 65, in export_item
    style=zq.backend.csl_style)
  File "/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.803FD61C-8B7B-408C-937D-A6271DE66336/zotquery/zotero.py", line 281, in func_wrapper
    return self._retrieve_data(url, **kwargs)
  File "/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.803FD61C-8B7B-408C-937D-A6271DE66336/zotquery/zotero.py", line 242, in _retrieve_data
    self.request.raise_for_status()
  File "/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.803FD61C-8B7B-408C-937D-A6271DE66336/workflow/web.py", line 263, in raise_for_status
    raise self.error
HTTPError: HTTP Error 400: Bad Request
17:42:37 workflow.py:1903 DEBUG    Workflow finished in 1.254 seconds.
[ERROR: alfred.workflow.output.script] Code 1: 17:42:37 workflow.py:1457 DEBUG    Stored data loaded from : /Users/Damiennew/Library/Application Support/Alfred 2/Workflow Data/com.hackademic.zotquery2/local_zotero.json
17:42:37 workflow.py:1514 DEBUG    Stored data saved at : /Users/Damiennew/Library/Application Support/Alfred 2/Workflow Data/com.hackademic.zotquery2/local_zotero.json
17:42:37 workflow.py:1457 DEBUG    Stored data loaded from : /Users/Damiennew/Library/Application Support/Alfred 2/Workflow Data/com.hackademic.zotquery2/zotquery_backend.json
17:42:37 workflow.py:2150 DEBUG    Got password : com.hackademic.zotquery2:web_zotero
17:42:37 workflow.py:2044 INFO     Checking for update ...
17:42:37 background.py:180 DEBUG    Command arguments cached to `/Users/Damiennew/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.hackademic.zotquery2/__workflow_update_check.argcache`
17:42:37 background.py:184 DEBUG    Calling [u'/usr/bin/python', '/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.803FD61C-8B7B-408C-937D-A6271DE66336/workflow/background.pyc', u'__workflow_update_check'] ...
17:42:37 workflow.py:1903 DEBUG    Workflow finished in 0.005 seconds.
17:42:37 workflow.py:1903 DEBUG    Workflow finished in 0.003 seconds.
17:42:37 background.py:189 DEBUG    Executing task `__workflow_update_check` in background...
17:42:37 zotquery.py:95 INFO     - - - NEW RUN - - -
17:42:37 workflow.py:1903 DEBUG    Workflow finished in 0.005 seconds.
Usage:
    zotquery.py configure <flag> [<argument>]
    zotquery.py search <flag> [<argument>]
    zotquery.py store <flag> <argument>
    zotquery.py export <flag> <argument>
    zotquery.py append <flag> <argument>
    zotquery.py open <flag> <argument>
    zotquery.py scan <flag> [<argument>]
Link to comment

Hmmm... This is all quite interesting. The IndexError: string index out of range error suggests that you have some references without the family (i.e. last name) field set. Both times that error occurs when the workflow is first run, with the first letter of the query you are entering (once with "o", another time with "a"), which results in lots of results. In iterating over these many results, the workflow hits some without last names. This is a bug. I will need to fix it. However, it also suggests that your Zotero data has some funny points.

As for the export error, the problem is not with the workflow, but with the Zotero API. The workflow is attempting to get the information from your Zotero library, but the Zotero server says there is a problem. This is likely caused by one of two issues: first, your authentication information might be incorrect. Do any export commands work? Short references or long references? Any item? If so, then the authentication information is fine. If all requests fail, we should look there first. Second, your local Zotero data may not be synced with your remote (i.e. cloud) Zotero data. In the Zotero client, in the top right, you have the sync button. Pressing that will sync your local info with your remote account. When exporting citations, ZotQuery uses the Zotero API with your remote (cloud) data. So, if you have an item in your local library, ZotQuery will find it and make it available to you, but if that item hasn't been synced to the cloud, then the Zotero API doesn't know about it and spits back an error.

If it is neither of these two issues, we will have to dig deeper. But I'm hoping that these two most common issues will fix the problem. As for the other problem, I will try to replicate it and then fix it ASAP.

Again, thank you so much for working out the kinks in this beta release. I hope it's not overly frustrating to have a partially working workflow, but once I get the kinks worked out, it'll be great. As an example, when the workflow searches for one letter (like "o") using the general query, it returns 2968 results in about a second and a half. That is crazy faster than the older version.

Anyways, let me know about how the troubleshooting goes.

stephen

Link to comment

Hmmm... This is all quite interesting. The IndexError: string index out of range error suggests that you have some references without the family (i.e. last name) field set. Both times that error occurs when the workflow is first run, with the first letter of the query you are entering (once with "o", another time with "a"), which results in lots of results. In iterating over these many results, the workflow hits some without last names. This is a bug. I will need to fix it. However, it also suggests that your Zotero data has some funny points.

Hmm. That is interesting. If I go to zotero and seach for 'olden' none of the entries are missing a last name, same for 'olde', there are a lot more entries for 'old' but I couldn't find any missing a last name there either, that said, I am sure that some of my zotero data has some funny points! Lots without any names for example (newspaper articles without author), others with only last name.

 

 

As for the export error, the problem is not with the workflow, but with the Zotero API. The workflow is attempting to get the information from your Zotero library, but the Zotero server says there is a problem. This is likely caused by one of two issues: first, your authentication information might be incorrect. Do any export commands work? Short references or long references? Any item?

 

As far as I can work out, no. I should have said, I do get a notification saying that data has been copied to the clipboard: Full reference Copied! Format:[stuff]

My zotero is synced, and I access it on my ipad and iphone regularly, using zotpad and papership.

 

I'm not bothered at all by the small bugs, it's a great job your doing, I'm pleased to be able to help. 

 

I checked my zotero settings, and the key and userid is correct, it says that zotquery last accessed zotero 3 mins ago. I don't know if this could be related, but I've never been able to get copy and paste from zotero standalone to work, I need to drag my files into scrivener (another reason why zotquery looks so appealing!) These days I can use Alfred's clipboard for recently used cites which is also handy.

 

Another bit of information: Last night I added another attachment to an entry - when I search for that entry now using ZQ it says theres only 1 attachment, I have tried updating the cache and zotero tells me it is synced.

 

I hope that gives you the information you need to debug some more, let me know if there's anything else I can do.

Damian

Link to comment

Hmm. That is interesting. If I go to zotero and seach for 'olden' none of the entries are missing a last name, same for 'olde', there are a lot more entries for 'old' but I couldn't find any missing a last name there either, that said, I am sure that some of my zotero data has some funny points! Lots without any names for example (newspaper articles without author), others with only last name.

The error arose with a query for "o", and it was one out at 2700+ items that had the error. But I've fixed that bug. So it won't matter. Items without a last name will have xxx. there instead.

As far as I can work out, no. I should have said, I do get a notification saying that data has been copied to the clipboard: Full reference Copied! Format:[stuff]

My zotero is synced, and I access it on my ipad and iphone regularly, using zotpad and papership.

 

I'm not bothered at all by the small bugs, it's a great job your doing, I'm pleased to be able to help. 

 

I checked my zotero settings, and the key and userid is correct, it says that zotquery last accessed zotero 3 mins ago. I don't know if this could be related, but I've never been able to get copy and paste from zotero standalone to work, I need to drag my files into scrivener (another reason why zotquery looks so appealing!) These days I can use Alfred's clipboard for recently used cites which is also handy.

OK. All this does is make the debugging trickier. Your info is correct. Your account is synced. My next guess would be another input error on my part. To test this, turn the debugger on and try to export three different items. Copy the bug report and send it to me. We will go from there.

Another bit of information: Last night I added another attachment to an entry - when I search for that entry now using ZQ it says theres only 1 attachment, I have tried updating the cache and zotero tells me it is synced.

 

I hope that gives you the information you need to debug some more, let me know if there's anything else I can do.

Damian

I will read over the attachment caching code. There could very well be a bug in there; who knows.

Link to comment

Ok, the first export I tried to do this time worked! It was a short citation and I've copied the debug report to https://gist.github.com/a63db8b59a5570f2aae2.git

 

The second export didn't work, it was a full citation.

 

https://gist.github.com/b89491130e17551b2345.git

 

Third export was for same zotero entry as first one, full citation and didn't work:

 

https://gist.github.com/cb0651da62514a6e0a8e.git

 

I've just realised that you also wrote the Kickass worksflow - which I also can't get to work! I get a 'nonetype' object has no attribute 'text' error! But isn't the place for that! I'm not sure where is, maybe you can direct me. I hope this isn't a hassle for you, you probably have other things to do, I have the night off!

Link to comment

Ok, the first export I tried to do this time worked! It was a short citation and I've copied the debug report to https://gist.github.com/a63db8b59a5570f2aae2.git

 

The second export didn't work, it was a full citation.

 

https://gist.github.com/b89491130e17551b2345.git

 

Third export was for same zotero entry as first one, full citation and didn't work:

 

https://gist.github.com/cb0651da62514a6e0a8e.git

 

I've just realised that you also wrote the Kickass worksflow - which I also can't get to work! I get a 'nonetype' object has no attribute 'text' error! But isn't the place for that! I'm not sure where is, maybe you can direct me. I hope this isn't a hassle for you, you probably have other things to do, I have the night off!

All three of these report not working. The first report follows the exact pattern as the third, just at different times. Search for "anderson", try to export full reference. Get bad request.

The second one says that the server can't find it.

I will look into the errors. But network stuff is harder and will probably take me longer.

Link to comment

Hi,

 

Just read your reply on the KA torrent saying maybe my connection is dodgy. Yes, I have a crap internet connection, 1mb most of the time, almost enough to stream video, but not reliably. Uploading a 2MB file takes time, but it is on, and does work. Do you think this could be the reason I'm having trouble? Alfred workflows rely on a reasonably quick reply from the net or else they think the connections broken or something?  Other workflows such as 'Should I watch this movie?', 'packal updater', 'urban dictionary', 'libgen' all work everytime, but maybe they aren't trying to connect to the same type of thing (though I would have though libgen and KA would be similar?

Link to comment

TBH, I'm not much of a network guy, so I can't speak with great authority, but this is the issue as I basically see it. First, let's take the KA workflow. It's a bit odd because KA is a bit odd. It sends zipped data across the network, which the workflow then has to unzip and then interpret. This is in contrast with LibGen, which just sends the data directly. So, there is a contrast between a "stream" of data being sent and a "package" of data (ultimately, both are streams, but I'm playing with metaphors, so whatever). With the "stream" of data, pieces are being sent one at a time, and the receiver (the workflow in this case) needs to collect all the pieces, put them together, and then will interpret the whole thing. When it's just a package being sent, you get the whole thing in one call. Because KA sends zipped data, it's sending a "stream", not a "package". The workflow is trying to interpret the whole package before it all gets there. This is ultimately a problem with the workflow, so I will have to figure it out.

As for ZotQuery, I have to assume the same basic issue is the problem. Again, since I'm not a network guy, I don't really know what's going on, but I will ask around and look into it. This problem will take some time tho, given my basic ignorance.

Link to comment
  • 1 month later...

I have been trying to update the dataset cache, but I get this error: 

 

[ERROR: alfred.workflow.action.script] 07:45:11 workflow.py:1263 ERROR    [Errno 2] No such file or directory: u'missing value'

Traceback (most recent call last):

  File "/Users/sdaza/Dropbox/Alfred2/Alfred.alfredpreferences/workflows/user.workflow.89B1EB42-50D8-44BC-A99F-0FCAA2F6D384/workflow/workflow.py", line 1261, in run

    func(self)

  File "zotquery.py", line 1502, in main

    print z_cacher.cache()

  File "zotquery.py", line 306, in cache

    if self.setup():

  File "zotquery.py", line 195, in setup

    shutil.copyfile(self.zot_db, self.clone_db)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 82, in copyfile

    with open(src, 'rb') as fsrc:

IOError: [Errno 2] No such file or directory: u'missing value'

 

Any ideas?

Edited by Sebastian Daza
Link to comment
  • 6 months later...

Is there a way to search the URL of one of my references and have the workflow find it? I have a ton of URLs in a document that I'm converting to proper citations, but I can't work out if Alfred can find and export a citation based on its URL. All the different searches turn up nothing.

Link to comment
  • 2 weeks later...

I'm not exactly following. In Zotero, what field is the URL stored in?

 

What do you mean by "if Alfred can find and export a citation based on its URL"? Do you mean use ZotQuery to find a particular citation via its URL and then from ZotQuery export that citation? If that is what you mean, then this could be possible, I just need to know more about what these URLs are.

Link to comment
  • 5 months later...
I have tried to make Zotquery work, but can’t.
 
I originally installed v. 10 as found on Github. Even though it locates references fine, when I export citations/references I just get a “success” like message, but nothing is copied to the clipboard. Also, export settings and configuration doesn’t work either, nothing happens when those options are chosen.
 
 
Then I have deleted everything from v. 10 and installed v. 8.5 as found on Packal instead. Unfortunately this version just pops up a message saying “installing workflow dependencies”, when I invoke any z command.
 
There's a log here.
 
So I am stuck. Am I missing something?
 
OSX10.11.3, Alfred2

 

Link to comment
  • 1 month later...

According to a post of the author of Zotquery version 10.0 does not work in the moment (https://github.com/smargh/alfred_zotquery/issues/6); however, version 8.5 from Packal should work. I had the same problems with version 8.5 you described above. 

 

Change the following line of code in bundler.py in the directory ~/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.your-id

 

lines 161 and 162

 

PIP_INSTALLER_URL = ('https://raw.githubusercontent.com/pypa/pip/'
                     'develop/contrib/get-pip.py')
to 

PIP_INSTALLER_URL = ('https://bootstrap.pypa.io/get-pip.py')
Should work then. Edited by deanishe
Fix link and format code.
Link to comment
  • 1 month later...

Beakmachine - 

 

Many thanks for posting the fix to the Packal version. The zotquery was showing the pop up that it was installing dependencies, then failing silently. Glancing at the debug log in Alfred showed the get-pip issue, but I never would have known to edit the bundler.py file.  

Link to comment
  • 4 weeks later...

I have this message no matter which i try to do with zotquery

Worflow libraries are bieng updated
Your workflow will continue momentarily

I have done the change for get-pip on the workflow installed in Alfred 3 but it seems I have another problem as there is an error in the log of the worflow

 File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 558, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found

Any idea ?

Link to comment
  • 3 weeks later...
  • 10 months later...
  • 2 months later...

Hi, All - Just FYI, I've upgraded to Alfred 3, and also to the just-released Zotero 5.  Having already done the get-pip change, I'm not having  that error.

 

All the search functionality still works, but the the database cache isn't updating any more - this seems to be connected to changes to the underlying database schema (from the logs "no such column: creatorDataID"). I've started poking around the way Zotero deals with its SQL database a bit, to see what they've changed, though I've no real confidence in my ability to solve the issues.

Link to comment
  • 2 weeks later...

I can't imagine demand is high, but I've hacked together a local version that (sort) of works. It involved editing the workflow scripts (to call Alfred 3 instead of 2), changing permissions on the Alfred v2 paths it uses (application support), editing a bunch of SQL calls to various fields that Zotero has moved around, plus the "get-pip" fix above and the "fixum" script for out of date dependencies.

 

 I've broken a few things in the process (e.g., the "open attachment" functionality doesn't work, but copying citations does. I suspect anyone using a Zotero library with multiple users/group collections should also stick with supported tools.

 

But, good enough for now. And that's enough time spent tinkering with someone else's work - my profound thanks to the workflow's creator, and hopefully s/he's moved on to bigger and better things. 

 

 

Link to comment

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
×
×
  • Create New...