Jump to content

evanfuchs

Member
  • Posts

    100
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by evanfuchs

  1. I've run into an issue with the Clipboard History Viewer.

     

    If I hit Return on an item in the viewer, the item is pasted into the foreground app as expected. However, if I Command-C an item in the viewer (to avoid pasting it), rather than copying the item back to the clipboard, it copies "/Users/<username>/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/mr.pennyworth.gif/selected.gif"

     

    Disabling the workflow has no effect, but killall AlfredGifBrowser restores the expected behavior until I run the workflow again.

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

  3. 48 minutes ago, deanishe said:

    A more sensible approach would be to change fuzzylist.py to accept a filename as an argument and use the same script for every Script Filter.

    Basically, theFile = sys.argv[1]

     

    That makes sense. When I change theFile = "list.csv" to theFile = sys.argv[1]  I get an error NameError: name 'sys' is not defined whenever I try to provide any argument.

     

    As I said, I don't know what I am doing but I am trying :)

     

     

     

  4. 19 hours ago, evanfuchs said:

    how I would go about having multiple lists within the single workflow, each with their own their own trigger?

     

    I know this can be done by iterating through multiple csv files in the original script, but I don't know how to do that. Trying to help myself and anyone who might stumble across this, this works:

     

    • Add another csv file (list2.csv) to the workflow directory
    • Duplicate fuzzylist.py (fuzzylist2.py), and change the following line:
    • Change theFile="list.csv" to theFile="list2.csv"
    • Duplicate the Script Filter Object and change the reference to fuzzylist.py to fuzzylist2.py in its script.
  5. 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.

  6. 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!

     

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

     

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

     

  9. @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.

  10. 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:

     

    image.png.2a89d00325dbe46d715796073ef06c9b.png

     

    I selected that dictionary and it began installing html files until:

     

    image.png.42bda2704dd6d39d97bfda047d2f972c.png

    I open Console and installation continued for a few seconds until:

     

    image.png.d497cddb28aa7d2ea184b4c1282fbfc9.png

     

    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?

  11. This has been really helpful for me with a workflow I've been running several times a day for a couple years. Thank you!

     

    I duplicated the entire workflow for an another application, but how I would go about having multiple lists within the single workflow, each with their own their own trigger? I understand list.json is generated from list.csv, so I imagine the solution would be creating another json from a different csv, but I dont know anything about python.

     

    Any help would be appreciated :)

  12. 12 minutes ago, rob213 said:

    - I always do this on highlighted text. I would like the initial copy to clipboard to be included in the workflow, so that the final paste overwrites the selected text with the post transformation text, which happens automatically in my nobel prize winning script below.

    Can't you do this in the newer version by adding a Hotkey with argument "Selection in macOS" and setting the Copy to Clipboard output to "Automatically paste to front most app"?

  13. 1 hour ago, JLo said:

    When I find the image I want, instead of Cmd+C, is there a way to just direct it to the Preview App automatically?

     

    This workflow might interest you:

     

     

    You can Quick Look clipboard images with SHIFT, then Open with Preview.

     

    RETURN will save the image AND delete it from Alfred's clipboard history, but the Quick Look is non-destructive.

  14. Set up a single Keyword input (with argument required) that connects to multiple Open URL objects. Set the URL of each object to the search query used by the site you want to open, using "{query}" in place of the search term. For example, this will open a new tab and perform a Google Image search https://www.google.com/search?tbm=isch&as_q={query} . Then choose Firefox from the Browser dropdown box in each object.

     

    image.png.3187985ab3337952668df7155a4ad7fb.png

  15. If the input is always in that format, one way to do it that might also give you some ideas for general use would be the Argument and Variables UtilityReplace Utility

     

    image.png.aca6fb34f7a4011c52e51b5ba2818f1d.png

     

    • The input is keyword with No Argument.
    • The Argument and Variables Utility with {clipboard} as the argument passes the text string from the clipboard to the Replace Utility
    • Replace Utility is set to regex, with an expression that groups the text string received from the previous object into three groups:
      • Group 1) "https://drive.google.com/uc?id="
      • Group 2) whatever is in between Groups 1 and 3 (in this case "1DwOwtpOX-tVb5xd7kws7y1oTZQCJtUtF")
      • Group 3) "&export=download"
      • Then replaces them with "https://drive.google.com/file/d/" + Group 2 ("1DwOwtpOX-tVb5xd7kws7y1oTZQCJtUtF") + "?usp=sharing" as the new string with gets sent as {query} to the next workflow object.
      • From there you can output it back to the clipboard, ready to paste. My screenshot shows Large Type for output just so I could see it and compare to yours.
      • The values in the Replace Utility are Replace regex (https:\/\/drive\.google\.com\/uc\?id=)(.*?)(&export=download) with https://drive.google.com/file/d/$2/view?usp=sharing 
    • If you want to avoid regex, you can use two Replace Utility objects:

     

    image.png.bb1b84c96e83787da5a4ac682ea86ab5.png

     

    There may be prettier ways to do it, but I thought this might be helpful to see how some of these objects can be strung together.

     

  16. It would be handy to be able to get a larger view of images in the Clipboard Viewer, like you can in the main Alfred window by pressing Shift. The default image preview size is based on Alfred’s window size as set in Theme preferences. This feature would allow the user to “zoom” Clipboard History images as needed.

     

    Additional actions like Add to Buffer, Show Action Panel, and Save As (as in this workflow) would be even better :)

  17. I like for Alfred to remember its dragged position, but I'd like to re-center the window without having to drag it with the mouse.

     

    Is it possible to manipulate Alfred's window position by keyboard, a workflow, script, etc? My goal would be to trigger Alfred, then if the window is off in a corner, hit a hotkey/keyword/shortcut to center the window and ideally leave it open for next command.

     

    Thanks

×
×
  • Create New...