Jump to content

Recommended Posts

@Mr Pennyworth After running that command:

 

No matching processes belonging to you were found
No matching processes belonging to you were found
UpdateRecents: about to call HIS_XPC_GetApplicationPolicyForURLs with seed 4111266682
UpdateRecents: received results from HIS_XPC_GetApplicationPolicyForURLs
UpdateRecents: ignoring results because menu isn't open
UpdateRecents: about to call HIS_XPC_GetApplicationPolicyForURLs with seed 4111266682
UpdateRecents: received results from HIS_XPC_GetApplicationPolicyForURLs
UpdateRecents: ignoring results because menu isn't open
UpdateRecents: about to call HIS_XPC_GetApplicationPolicyForURLs with seed 4111266682
UpdateRecents: received results from HIS_XPC_GetApplicationPolicyForURLs
UpdateRecents: ignoring results because menu isn't open
UpdateRecents: about to call HIS_XPC_GetApplicationPolicyForURLs with seed 3818306133
UpdateRecents: received results from HIS_XPC_GetApplicationPolicyForURLs
UpdateRecents: ignoring results because menu isn't open
UpdateRecents: about to call HIS_XPC_GetApplicationPolicyForURLs with seed 3818306133
UpdateRecents: received results from HIS_XPC_GetApplicationPolicyForURLs
UpdateRecents: ignoring results because menu isn't open
UpdateRecents: about to call HIS_XPC_GetApplicationPolicyForURLs with seed 3818306133
UpdateRecents: received results from HIS_XPC_GetApplicationPolicyForURLs
UpdateRecents: ignoring results because menu isn't open
UpdateRecents: about to call HIS_XPC_GetApplicationPolicyForURLs with seed 3818306133
UpdateRecents: received results from HIS_XPC_GetApplicationPolicyForURLs
UpdateRecents: ignoring results because menu isn't open
UpdateRecents: about to call HIS_XPC_GetApplicationPolicyForURLs with seed 3077976816
UpdateRecents: received results from HIS_XPC_GetApplicationPolicyForURLs
UpdateRecents: ignoring results because menu isn't open
UpdateRecents: about to call HIS_XPC_GetApplicationPolicyForURLs with seed 3077976816
UpdateRecents: received results from HIS_XPC_GetApplicationPolicyForURLs
UpdateRecents: ignoring results because menu isn't open
UpdateRecents: about to call HIS_XPC_GetApplicationPolicyForURLs with seed 3077976816
UpdateRecents: received results from HIS_XPC_GetApplicationPolicyForURLs
UpdateRecents: ignoring results because menu isn't open
UpdateRecents: about to call HIS_XPC_GetApplicationPolicyForURLs with seed 3077976816
UpdateRecents: received results from HIS_XPC_GetApplicationPolicyForURLs
UpdateRecents: ignoring results because menu isn't open

 

Unlike before, I also saw:

image.png.bc126f44d14ba2cdbf4ff312f919e51f.png

image.png.73172c913a60e598cc58435b111aa7a7.png

After a bit that window went away.

Edited by evanfuchs
Link to post
  • Replies 65
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Better Dictionaries Better search and live previews for built-in macOS dictionaries.   This post might be outdated, link to up-to-date README Download the latest version: Better.Dict

That folder only exists if a user has adjusted the settings in Alfred Preferences > Appearance > Options.

Sorry folks for all the errors and failures you keep running into!   The workflow is way too hacky with no good logging, error reporting and very poor debugging... I started working on a rev

Posted Images

@evanfuchs aw man that's the worst.
A bug that goes away when run from terminal.

That's a known bug with no solution yet https://github.com/pyinstaller/pyinstaller/issues/5109

But in my trials that bug wasn't getting triggered.
I have tested this workflow only on Catalina by the way. Are you on Catalina or some other version?

While I think about how I could go about debugging / diagnosing this, you could manually import a dictionary. By running the same command as above, but using  '/Users/<your username here>/Library/Application Support/Alfred/Workflow Data/mr.pennyworth.betterDicts' instead of /tmp/.

That's hoping that even though the bug affects the import, maybe it won't affect the lookup 🤞🏼

Edited by Mr Pennyworth
Link to post
1 hour ago, Mr Pennyworth said:

While I think about how I could go about debugging / diagnosing this, you could manually import a dictionary. By running the same command as above, but using  '/Users/<your username here>/Library/Application Support/Alfred/Workflow Data/mr.pennyworth.betterDicts' instead of /tmp/.

 

Not sure if I followed you correctly, but I tried that (with the correct username) and:

 

No matching processes belonging to you were found
Traceback (most recent call last):
  File "/Users/xxx/Dropbox/applications/Alfred-app/Alfred.alfredpreferences/workflows/user.workflow.E0E103F2-208F-48F7-B4DF-C096F6FDD948/BetterDict.app/Contents/Resources/__boot__.py", line 411, in <module>
    _run()
  File "/Users/xxx/Dropbox/applications/Alfred-app/Alfred.alfredpreferences/workflows/user.workflow.E0E103F2-208F-48F7-B4DF-C096F6FDD948/BetterDict.app/Contents/Resources/__boot__.py", line 394, in _run
    exec(compile(source, path, "exec"), globals(), globals())
  File "/Users/xxx/Dropbox/applications/Alfred-app/Alfred.alfredpreferences/workflows/user.workflow.E0E103F2-208F-48F7-B4DF-C096F6FDD948/BetterDict.app/Contents/Resources/BetterDict.py", line 380, in <module>
    import_dict(dict_path, base_dir)
  File "/Users/xxx/Dropbox/applications/Alfred-app/Alfred.alfredpreferences/workflows/user.workflow.E0E103F2-208F-48F7-B4DF-C096F6FDD948/BetterDict.app/Contents/Resources/BetterDict.py", line 276, in import_dict
    info = dict_info(dict_path)
  File "/Users/xxx/Dropbox/applications/Alfred-app/Alfred.alfredpreferences/workflows/user.workflow.E0E103F2-208F-48F7-B4DF-C096F6FDD948/BetterDict.app/Contents/Resources/BetterDict.py", line 207, in dict_info
    return readPlist(f'{dict_path}/Contents/Info.plist')
  File "/Users/xxx/Dropbox/applications/Alfred-app/Alfred.alfredpreferences/workflows/user.workflow.E0E103F2-208F-48F7-B4DF-C096F6FDD948/BetterDict.app/Contents/Resources/BetterDict.py", line 65, in readPlist
    with open(plist_path, 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/xxx/Dropbox/applications/Alfred-app/Alfred.alfredpreferences/workflows/user.workflow.E0E103F2-208F-48F7-B4DF-C096F6FDD948/BetterDict.app/Contents/Resources/System/Library/AssetsV2/com_apple_MobileAsset_DictionaryServices_dictionaryOSX/4094df88727a054b658681dfb74f23702d3c985e.asset/AssetData/New Oxford American Dictionary.dictionary/Contents/Info.plist'
2020-12-03 06:56:54.727 BetterDict[2600:44830] BetterDict Error
UpdateRecents: about to call HIS_XPC_GetApplicationPolicyForURLs with seed 2988954240
UpdateRecents: received results from HIS_XPC_GetApplicationPolicyForURLs
UpdateRecents: ignoring results because menu isn't open
UpdateRecents: about to call HIS_XPC_GetApplicationPolicyForURLs with seed 2988954240
UpdateRecents: received results from HIS_XPC_GetApplicationPolicyForURLs
UpdateRecents: ignoring results because menu isn't open
UpdateRecents: about to call HIS_XPC_GetApplicationPolicyForURLs with seed 2988954240
UpdateRecents: received results from HIS_XPC_GetApplicationPolicyForURLs
UpdateRecents: ignoring results because menu isn't open
UpdateRecents: about to call HIS_XPC_GetApplicationPolicyForURLs with seed 2988954240
UpdateRecents: received results from HIS_XPC_GetApplicationPolicyForURLs
UpdateRecents: ignoring results because menu isn't open

 

Link to post

Can you share the command you ran before (the one with tmp) and the command you ran now? Just want to make sure that the tmp part is the only thing that changed and nothing else got unintentionally changed...

From the output, it appears that something else also changed apart from tmp...

Link to post
9 minutes ago, Mr Pennyworth said:

Can you share the command you ran before (the one with tmp) and the command you ran now? Just want to make sure that the tmp part is the only thing that changed and nothing else got unintentionally changed...

From the output, it appears that something else also changed apart from tmp...

 

Yes. Thanks for sticking with me. I had started over so I ran the first import command to tmp, then run it again with '/Users/<your username here>/Library/Application Support/Alfred/Workflow Data/mr.pennyworth.betterDicts'

 

I ended up with two keys. Removed one of them and I can get to the lookup, but it's botched:

 

image.png.ee384e42df17d42a4a37e4975f0ff986.png

 

Oh this is what I ran with my username:

 

killall alfred-dict-server; killall BetterDict; ./BetterDict.app/Contents/MacOS/BetterDict import '/System/Library/AssetsV2/com_apple_MobileAsset_DictionaryServices_dictionaryOSX/4094df88727a054b658681dfb74f23702d3c985e.asset/AssetData/New Oxford American Dictionary.dictionary' '/Users/xxx/Library/Application Support/Alfred/Workflow Data/mr.pennyworth.betterDicts'

 

Edited by evanfuchs
Link to post

Ah! the theming looks unfortunate :(

While I figure out how best to fix it, here are your two options:

  1. Change Alfred's theme to one where color of Alfred's window is different from color of the text in search bar (right now, in your theme, both of those colors are white)

    If you don't want to change the these, alternatively:


     
  2. open this file '/Users/<username>/Library/Application Support/Alfred/Workflow Data/mr.pennyworth.betterDicts/<dict-ID>/html/dict-entry.css'
    (by using appropriate <username> and <dict-ID>)
    At the top, you'll find some code like this:
    :root
    {
        --secondary-label: var(--result-subtext-color, #eee);
        --text: var(--search-text-color, #eee);
        --link: var(--result-text-colorSelected, var(--link));
    }
    
    html
    {
        background-color: var(--window-color, #1d1e28);
        color: var(--search-text-color, #eee);
    }

     

     

    in the html part, change the background-color from --window-color to --search-background
    After that, run killall AlfredExtraPane in terminal (so that the viewer would be restarted and would pick up changes we made)

Edited by Mr Pennyworth
Link to post
16 minutes ago, Mr Pennyworth said:

 

  1. Change Alfred's theme to one where color of Alfred's window is different from color of the text in search bar (right now, in your theme, both of those colors are white)

Yep. Changed the theme. All good.

 

On another note, as I mentioned earlier, the only had one dictionary option. Should I have seen others, including thesaurus?

 

Thanks!

 

Link to post

It only lists dictionaries that are installed/available on your system. They are in /System/Library/AssetsV2/com_apple_MobileAsset_DictionaryServices_dictionaryOSX/

 

And not all of them are importable. To get a list of all the importable ones, run these in terminal:

  • cd '/System/Library/AssetsV2/com_apple_MobileAsset_DictionaryServices_dictionaryOSX/'

  • python -c 'import glob; print("\n".join(glob.glob("*.asset/AssetData/*.dictionary")))'

If the above shows multiple dictionaries, but still not the .dict-import command in Alfred, I believe it might still be because of the bug I mentioned earlier.

 

In that case, I'm afraid you'll have to import them manually just like you imported this oxford one.

 

OTOH, if the dictionaries aren't present at all on your system, you can download/enable them by opening Dictionary.app, and then going to preferences.

Link to post
21 minutes ago, Mr Pennyworth said:

OTOH, if the dictionaries aren't present at all on your system, you can download/enable them by opening Dictionary.app, and then going to preferences

 

Odd. I have several Dictionaries (Thesaurus, Wikipedia, Terminology) enabled as shown in Dictionary.app Preferences, which work fine in the app, but there is only the one in '/System/Library/AssetsV2/com_apple_MobileAsset_DictionaryServices_dictionaryOSX/'

 

The "Open Dictionaries Folder" under File menu takes me to /Users/xxx/Library/Dictionaries/, where I have Terminology.

 

Anyway I feel like I've taken a lot of your time! Thanks for getting me going and for sharing the workflow.

Link to post

@evanfuchs Interesting...
Given that the GUI import isn't working anyway and you had to import using the command line, here's something you can try:

 

Look at the command you used for importing the oxford dictionary. In that command, after the word 'import', you had to provide the path to the '.dictionary' file, right? Run the same command, but this time, change that path to the appropriate path from '/Users/xxx/Library'...

Also if you could tell me what such a path looks like, I can add it to the workflow so that the dictionaries in this library folder are also detected by the workflow.

Link to post
3 hours ago, Mr Pennyworth said:

Look at the command you used for importing the oxford dictionary. In that command, after the word 'import', you had to provide the path to the '.dictionary' file, right? Run the same command, but this time, change that path to the appropriate path from '/Users/xxx/Library'...

 

Can't tell you how many times I tried this. At one point I got the thesaurus partially imported with a bunch of errors, then I tried to manually complete it in the workflow, until I ran up again the db entries. I deleted everything and tried once more, then it installed. 

 

3 hours ago, Mr Pennyworth said:

Also if you could tell me what such a path looks like, I can add it to the workflow so that the dictionaries in this library folder are also detected by the workflow.

 

  • As I mentioned earlier, I only had one dictionary (New Oxford American Dictionary) in the "default" folder: 
  • Terminology (Did not import this) here:  /Users/<username>/Library/Dictionaries/ 
  • And this might be helpful. I found the Thesaurus and other dictionaries here: /System/Library/AssetsV2/PreinstalledAssetsV2/InstallWithOs/com_apple_MobileAsset_DictionaryServices_dictionaryOSX/

Thanks again for all your help!

 

 

 

selected.gif

selected.gif

Edited by evanfuchs
Link to post
  • 2 months later...

Hi, really interested in this workflow but I keep getting an error pop up every time I try to import dictionary. I get the following errors:

 

[Fault] Transform 'MT_com.apple.automation.do_shell_script' hit unrecoverable error with reason='<private>' and context='<private>' with event='<private>!

 

attempted to call TCCAccessRequest without the com.apple.private.tcc.manage-bby-mn

 

and a few apple webkit errors. Would appreciate any help. Thanks!

Screenshot 2021-02-19 at 12.05.32.png

Link to post
  • 4 weeks later...
  • 3 weeks later...

Sorry folks for all the errors and failures you keep running into!

 

The workflow is way too hacky with no good logging, error reporting and very poor debugging... I started working on a revamped version with detailed logging, less moving parts and a consolidated code base in a single swift binary, but work at my day job has gotten way too hectic and the revamping of workflows and bugfixes have taken a backseat :(

 

I'd gladly merge pull requests though!

Thanks and apologies!

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

×
×
  • Create New...