majjoha Posted November 24, 2020 Share Posted November 24, 2020 @Mr Pennyworth: It basically just works right away after importing the dictionaries, and the hotkey functionality is really, really useful. Quite impressive. Thank you! Link to comment
scafaj Posted November 25, 2020 Share Posted November 25, 2020 (edited) I think something went wrong during the importation and now nothing is showing up. I already give the required permission I imported two dictionary (Multidictionnary french & Oxford French) now when I type lookup > Oxford > Already desapear @Mr Pennyworth Is it possible to completely remove and reinstall the imported data? I didn't find their location EDIT: I found the location /Users/{usr}/Library/Application Support/Alfred/Workflow Data/mr.pennyworth.betterDicts/ I remove everything and reinstalled but it doesn't seem to works. I open alfred I type lookup ->I select the first dictionnary ---> I search for "jouer" and after the loading and nothing is found EDIT2: Logs debug: Traceback (most recent call last): File "AlfredExtraPane.app/Contents/Resources/scripts/alfred-extra-pane", line 58, in <module> 'minHeight': alfred.window_height(9), File "/Users/scafaj/Documents/Alfred.alfredpreferences/workflows/user.workflow.10320334-A10C-4A5A-B4B2-647DE6B35728/AlfredExtraPane.app/Contents/Resources/scripts/alfred.py", line 27, in cached_func cache[args] = func(*args) File "/Users/scafaj/Documents/Alfred.alfredpreferences/workflows/user.workflow.10320334-A10C-4A5A-B4B2-647DE6B35728/AlfredExtraPane.app/Contents/Resources/scripts/alfred.py", line 259, in window_height + result_height() * item_count) File "/Users/scafaj/Documents/Alfred.alfredpreferences/workflows/user.workflow.10320334-A10C-4A5A-B4B2-647DE6B35728/AlfredExtraPane.app/Contents/Resources/scripts/alfred.py", line 27, in cached_func cache[args] = func(*args) File "/Users/scafaj/Documents/Alfred.alfredpreferences/workflows/user.workflow.10320334-A10C-4A5A-B4B2-647DE6B35728/AlfredExtraPane.app/Contents/Resources/scripts/alfred.py", line 215, in search_field_height }''')) ValueError: invalid literal for int() with base 10: '' Edited November 25, 2020 by scafaj Link to comment
Mr Pennyworth Posted November 25, 2020 Author Share Posted November 25, 2020 (edited) @scafaj hmm... not much info to investigate... I imported both the dictionaries that you mention and they worked properly. Few questions to help me understand the problem better: After importing the fist dictionary, did that work? How long did you wait between finishing the first import and starting the second import? Did you get a "waiting for index to be ready..." box after each import? (see screenshot) Can you post a screenshot of the workflow editor? Can you run this in terminal and post the output here? ls -alh ~/Library/Application\ Support/Alfred/Workflow\ Data/mr.pennyworth.betterDicts/ Can you paste the contents of ~/Library/Application\ Support/Alfred/Workflow\ Data/mr.pennyworth.betterDicts/db.loghttps://dpaste.com and post the link here? In case you just want to reset everything and start from a clean state Delete the workflow Run killall alfred-dict-server; killall BetterDict; rm -rf ~/Library/Application\ Support/Alfred/Workflow\ Data/mr.pennyworth.betterDicts/ Reinstall the workflow Edited November 25, 2020 by Mr Pennyworth dparke01 1 Link to comment
scafaj Posted November 25, 2020 Share Posted November 25, 2020 (edited) @Mr Pennyworth Just wanted to make sure you read my update on my first post. I posted the Error logs There is what you asked: ----- [2020-11-25T12:51:22Z INFO actix_web::middleware::logger] 127.0.0.1:49769 "POST /indexes/com-apple-dictionary-fr-Multi/settings/searchable-attributes HTTP/1.1" 202 14 "-" "python-requests/2.25.0" 0.001002 [2020-11-25T12:51:22Z INFO actix_web::middleware::logger] 127.0.0.1:49770 "POST /indexes/com-apple-dictionary-fr-Multi/settings/displayed-attributes HTTP/1.1" 202 14 "-" "python-requests/2.25.0" 0.000944 [2020-11-25T12:52:17Z INFO actix_web::middleware::logger] 127.0.0.1:49788 "POST /indexes/com-apple-dictionary-fr-Multi/documents HTTP/1.1" 202 14 "-" "python-requests/2.25.0" 0.675927 [2020-11-25T12:52:17Z INFO actix_web::middleware::logger] 127.0.0.1:49789 "GET /indexes/com-apple-dictionary-fr-Multi/updates/2 HTTP/1.1" 200 128 "-" "python-requests/2.25.0" 0.445154 [2020-11-25T12:52:19Z INFO actix_web::middleware::logger] 127.0.0.1:49791 "GET /indexes/com-apple-dictionary-fr-Multi/updates/2 HTTP/1.1" 200 128 "-" "python-requests/2.25.0" 0.248817 [2020-11-25T12:52:22Z INFO actix_web::middleware::logger] 127.0.0.1:49792 "GET /indexes/com-apple-dictionary-fr-Multi/updates/2 HTTP/1.1" 200 128 "-" "python-requests/2.25.0" 0.213380 [2020-11-25T12:52:24Z INFO actix_web::middleware::logger] 127.0.0.1:49793 "GET /indexes/com-apple-dictionary-fr-Multi/updates/2 HTTP/1.1" 200 128 "-" "python-requests/2.25.0" 0.214964 [2020-11-25T12:52:26Z INFO actix_web::middleware::logger] 127.0.0.1:49794 "GET /indexes/com-apple-dictionary-fr-Multi/updates/2 HTTP/1.1" 200 128 "-" "python-requests/2.25.0" 0.217382 [2020-11-25T12:52:28Z INFO actix_web::middleware::logger] 127.0.0.1:49795 "GET /indexes/com-apple-dictionary-fr-Multi/updates/2 HTTP/1.1" 200 128 "-" "python-requests/2.25.0" 0.211065 [2020-11-25T12:52:31Z INFO actix_web::middleware::logger] 127.0.0.1:49796 "GET /indexes/com-apple-dictionary-fr-Multi/updates/2 HTTP/1.1" 200 128 "-" "python-requests/2.25.0" 0.236160 [2020-11-25T12:52:33Z INFO actix_web::middleware::logger] 127.0.0.1:49797 "GET /indexes/com-apple-dictionary-fr-Multi/updates/2 HTTP/1.1" 200 128 "-" "python-requests/2.25.0" 0.246990 [2020-11-25T12:52:35Z INFO actix_web::middleware::logger] 127.0.0.1:49798 "GET /indexes/com-apple-dictionary-fr-Multi/updates/2 HTTP/1.1" 200 128 "-" "python-requests/2.25.0" 0.246464 [2020-11-25T12:52:37Z INFO actix_web::middleware::logger] 127.0.0.1:49799 "GET /indexes/com-apple-dictionary-fr-Multi/updates/2 HTTP/1.1" 200 197 "-" "python-requests/2.25.0" 0.000146 [2020-11-25T12:54:01Z INFO actix_web::middleware::logger] 127.0.0.1:49807 "POST /indexes/com-apple-dictionary-fr-Multi/search HTTP/1.1" 200 3789 "-" "curl/7.64.1" 0.005789 Edited November 25, 2020 by scafaj Link to comment
Mr Pennyworth Posted November 25, 2020 Author Share Posted November 25, 2020 @scafaj: thanks! I had missed the update to your original post. The logs are helpful! I have a guess what is going on. Can you run this in terminal? osascript -e 'tell application "System Events" to display dialog "Hello!"' It should create a simple dialog box like this: If it does not, I'm not sure how to fix the problem, I had faced similar problem and wasn't able to find a solution. The only solution I know is rebooting Also, what Alfred theme are you using? Link to comment
Mr Pennyworth Posted November 25, 2020 Author Share Posted November 25, 2020 (edited) @scafajAlso to decide whether the problem is with the dictionary search and indexing or with the viewer, you can open http://127.0.0.1:6789/ in your browser and try searching there. Does it show results at all? Edited November 25, 2020 by Mr Pennyworth Link to comment
scafaj Posted November 25, 2020 Share Posted November 25, 2020 (edited) @Mr Pennyworth This script is working and I succesfully got the "Hello!" message I am using a custom theme but I tried with some other (except Alfred Classic) and still the same The localhost server is up and the meilisearch is working perfectly Edited November 25, 2020 by scafaj Link to comment
Mr Pennyworth Posted November 25, 2020 Author Share Posted November 25, 2020 (edited) @scafaj can you confirm that you aren't using 'Alfred Classic' theme? If you are, then either change the theme or duplicate it and use the duplicated one. If you are not, can you reboot and check if the problem persists? If you reboot and it persists, I'm not sure what might be going wrong... while I try to figure that out, you can do the following meanwhile: Open the workflow folder. Open the file search.sh The last two lines will be: echo "{ \"items\": $items }" \ | 'AlfredExtraPane.app/Contents/Resources/scripts/alfred-extra-pane' Change that to: echo "{ \"items\": $items }" (remove last line, and remove the "\" from second last line) This will disable live preview, but you'll get the search results. Pressing shift on a search result will give you a preview. Edited November 25, 2020 by Mr Pennyworth Link to comment
scafaj Posted November 25, 2020 Share Posted November 25, 2020 (edited) @Mr Pennyworth Ok I tried to reboot my mac but it doesn't fixed my issue. But when I removed the last line as you told me, it works Edited November 25, 2020 by scafaj Link to comment
Mr Pennyworth Posted November 25, 2020 Author Share Posted November 25, 2020 Quote ValueError: invalid literal for int() with base 10: @scafaj: regarding the above, make sure that alfred has Security & Privacy > Automation > System Events.app permission Link to comment
scafaj Posted November 25, 2020 Share Posted November 25, 2020 @Mr Pennyworth I didn't see this element. Link to comment
scafaj Posted November 25, 2020 Share Posted November 25, 2020 Maybe it's because I'm on Big Sur? Link to comment
Mr Pennyworth Posted November 25, 2020 Author Share Posted November 25, 2020 @scafaj hmm... sorry, I'm confused... is it working now? Or is the issue still there even after enabling "system events"? Link to comment
scafaj Posted November 25, 2020 Share Posted November 25, 2020 There is no "System events", look at my screenshot above Link to comment
Mr Pennyworth Posted November 25, 2020 Author Share Posted November 25, 2020 16 minutes ago, scafaj said: There is no "System events", look at my screenshot above I do see it... Google ChromeSystem Events Finder Terminal Link to comment
scafaj Posted November 25, 2020 Share Posted November 25, 2020 God, didn't even see it at first look 😴 luckily you put it in bold In fact it was already checked so, when i restore the default search.sh no results is shown... 😕 Link to comment
Mr Pennyworth Posted November 25, 2020 Author Share Posted November 25, 2020 @scafaj wow this is really puzzling I looked through all the permissions for alfred on my machine. The only outcome is: disable "System Events" and I get the exact same error that you get. Enable it back, and the error goes away. Given that that's not working on your machine, and I've tried everything that I can think of, now I'm out of ideas 🙁 Good to hear that the "press shift for preview" thing at least works... Link to comment
scafaj Posted November 25, 2020 Share Posted November 25, 2020 Okay thank you for your time, I'll use the "shift" method for now Link to comment
Vero Posted November 26, 2020 Share Posted November 26, 2020 @scafaj @Mr Pennyworth I haven't followed the full thread for this workflow, but given your most recent discussion about macOS permissions, I wanted to pop in and suggest that if these permissions were granted before upgrade to Big Sur, it may be wise to remove Alfred fully, then re-add (or allow apps to request permissions again). There haven't been many users experiencing permissions issues with Big Sur, but it's possible that there was some corruption of permissions. Removing and re-adding apps tends to resolve that particular issue. Beyond that, it's also worth looking at the workflow debugger in case there are specific errors that can help you establish what's happening (or failing to happen) on your Mac. Cheers, Vero Link to comment
chriswebb Posted December 2, 2020 Share Posted December 2, 2020 Hi there - I know that I'm doing something really simple (and wrong!), but whenever I try to do the .dict-import' command I get nothing but my fallback search options. What am I doing wrong? Link to comment
Mr Pennyworth Posted December 3, 2020 Author Share Posted December 3, 2020 @chriswebb is the workflow enabled? Can you share a screenshot of the workflow editor? Also, the debug logs... Link to comment
chriswebb Posted December 3, 2020 Share Posted December 3, 2020 Hi there - thanks for getting back to me so quickly. Yep, it's enabled The log looks like this: [11:36:10.944] Logging Started... [11:36:25.370] Better Dictionaries[Script Filter] Queuing argument '(null)' [11:36:25.377] Better Dictionaries[Script Filter] Script with argv '(null)' finished [11:36:25.381] ERROR: Better Dictionaries[Script Filter] Code 126: /Users/chriswebb/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/A2C6398C-8016-4F0E-AF49-71DBF40AEA59: line 1: ./BetterDict.app/Contents/MacOS/BetterDict: Permission denied Link to comment
Mr Pennyworth Posted December 3, 2020 Author Share Posted December 3, 2020 @chriswebb Can you click on "Open in Terminal" (as shown in your screenshot) and then try each of these commands and tell me the outputs? xattr -d com.apple.quarantine ./BetterDict.app xattr -d com.apple.quarantine ./BetterDict.app/Contents/MacOS/BetterDict ls -alh ./BetterDict.app/Contents/MacOS/BetterDict chmod +x ./BetterDict.app/Contents/MacOS/BetterDict After running them all, also check if the workflow starts working, and if not, lemme know what the log looks like Link to comment
evanfuchs Posted December 3, 2020 Share Posted December 3, 2020 I installed v1.2, ran .setup-better-dictionaries, granted permission in Accessibility to AlfredExtraPane.app, then ran .dict-import. I had choice of only one dictionary: I selected that dictionary and it began installing html files until: I open Console and installation continued for a few seconds until: Fans blazing for awhile. Hotkeys did not appear in the workflow and running lookup shows: [04:48:54.140] Logging Started... [04:48:55.420] Better Dictionaries[Script Filter] Queuing argument '(null)' [04:48:55.432] Better Dictionaries[Script Filter] Script with argv '(null)' finished [04:48:55.437] ERROR: Better Dictionaries[Script Filter] Code 1: Exited with error code but no message [04:48:58.054] Better Dictionaries[Script Filter] Queuing argument '(null)' [04:48:58.126] Better Dictionaries[Script Filter] Script with argv '(null)' finished [04:48:58.128] ERROR: Better Dictionaries[Script Filter] Code 1: cat: /Users/xxx/Library/Application Support/Alfred/Workflow Data/mr.pennyworth.betterDicts/imported.json: No such file or directory Deleted the workflow, rebooted, tried again with same result. Thoughts? Link to comment
Mr Pennyworth Posted December 3, 2020 Author Share Posted December 3, 2020 @evanfuchs could you try the following? Open the workflow folder in terminal and run ./BetterDict.app/Contents/MacOS/BetterDict listUnimported /tmp/ The output will contain path to the macOS dictionary file for the Oxford Dictionary. Let's say it is /a/b/c Then, run this command: killall alfred-dict-server; killall BetterDict; ./BetterDict.app/Contents/MacOS/BetterDict import '/a/b/c' /tmp/ The above command is basically for importing and extracting the dictionary into the temporary folder instead of the workflow data dir. We want to run BetterDict from terminal because we want to see why the "BetterDict error" appeared. (unlike the GUI version, this time, you'll get the error logs in terminal) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now