bikenik / alfred-ldoce

Alfred-ldoce-anki
MIT License
33 stars 6 forks source link

"Create from selected items" returns errors. My alfred tell me this #2

Closed yijinbandouya closed 6 years ago

yijinbandouya commented 6 years ago

2018-05-15 1 04 36

yijinbandouya commented 6 years ago

The log is below. [2018-05-15 14:45:39][utility.filter] Processing output of 'output.notification' with arg '{ "items": [ { "title": "Error: Cannot find module '../input/body.json'", "subtitle": "Press ⌘L to see the full error and ⌘C to copy it.", "valid": false, "text": { "copy": "\nError: Cannot find module '../input/body.json'\n at Object.<anonymous> (/Users/weifengchuiguodexiatian/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.E8B7962E-E0F3-4594-BE9B-238C2016A69D/src/api/mydata.js:4:21)\n at Object.<anonymous> (/Users/weifengchuiguodexiatian/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.E8B7962E-E0F3-4594-BE9B-238C2016A69D/src/index.js:14:14)\n\n\n-\nldoce-Express 1.1.3\nAlfred 3.6.1\ndarwin x64 16.0.0", "largetype": "Error: Cannot find module '../input/body.json'\n at Object. (/Users/weifengchuiguodexiatian/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.E8B7962E-E0F3-4594-BE9B-238C2016A69D/src/api/mydata.js:4:21)\n at Object. (/Users/weifengchuiguodexiatian/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.E8B7962E-E0F3-4594-BE9B-238C2016A69D/src/index.js:14:14)" }, "icon": { "path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns" } } ] } '

bikenik commented 6 years ago

I think.. It's happening cause you choose "Create from selected item" but do not select any item (vocabulary entry) before. You have to click to pick out from existing senses (vocabulary entries) of current query result and then ⌘ + ↩ — create card from selected senses of word

I'll fix these cases soon with a new update. Thanks a lot for your message.

p.s. Let me know if this explains the issue.

yijinbandouya commented 6 years ago

Thanks for your reply. It is very regrettable. As your answer, I tried again but still failed to add cards. Meanwhile, I found the "body.json" documents will delete if I choose to "create card from selected senses of word". But when I choose to "⌥ + ↩ — create card from all matching of current query", the document will come back. Another problem is when I install ldoce-express workflows 1.1.8, the search is invalid(like below). But the 1.1.3 is valid. 2018-05-15 5 50 40 2018-05-15 5 52 00

Your idea is very good. I have never seen who want to connect Alfred with Anki. Thanks again for your genius idea!Looking forward to your update.

bikenik commented 6 years ago

I try to explain it again for more clarity. To avoid this error

  1. select items or one item
  2. press ⌘ + ↩

I tested it quite a long time. And I got this error only occurs after these steps: when I do the second step before the first step. In other words - when I press ⌘ + ↩ but have not selected any items to this.

I found the "body.json" documents will delete if I choose to "create card from selected senses of word".

Everything is as it should be as you say. "body.json" will be deleted after each set of a new query. And generates again when you click to one or several fields of the query result. And only after that, you should press ⌘ + ↩ — to create card from selected senses of word.

https://youtu.be/MD6wpJJIzHc?t=53


Another problem is when I install ldoce-express workflows 1.1.8, the search is invalid(like below). But the 1.1.3 is valid.

I think you should delete all version from the "Alfred preferences" and install again as npm install --global alfred-ldoce

I tested it with a scratch install and wasn't get this issue. my end of path install is /usr/local/lib/node_modules/alfred-ldoce and symlink of this folder in: /Users/yourname/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/alfred-ldoce

If I'll understand why you getting this errors, I'll be writing here.

yijinbandouya commented 6 years ago

Thank you!It works! It is my careless. I only used keyboard to select. A click is ok. I think it will help me to study more english words.

bikenik commented 6 years ago

No problem. Keyboard to select items (enter/return or ↵) should work also 100%. Check your dependencies of this key with another application. When you activate this or that field from the query you will hear a sound signal (System mac os sound - "Pop") Glad to could help you. Happy English!

bikenik commented 6 years ago

solved af81d7a

yijinbandouya commented 6 years ago

Thank you very much! All problems are solved.