Jump to content

lehcar3

Member
  • Posts

    11
  • Joined

  • Last visited

Posts posted by lehcar3

  1. Per the "insert variable" {} menu on the Large Type output, we should be able to add a snippet value if we use the preface snippet: and use the keyword of the snippet. This is also explained in documentation here: https://www.alfredapp.com/help/workflows/advanced/placeholders/#snippets

     

    * What you were doing when the issue happened

    Trying to show a snippet value in large type, it doesn't resolve


    * Whether you were able to replicate it a second time by performing the same action

    Yes


    * Include any screenshots that might help us

    Screenshot 1: my large type (workflow steps shown immediately below the large type box -- I isolated the steps keyword->large type while troubleshooting. keyword has no argument)

     

    Screenshot 2: the value of my snippet over in the snippet section of Alfred UI. Nothing special (dynamic) about it. Uses ! prefix.

     

    Screenshot 3: the large type output. Snippet does not resolve


    * Include the Alfred version & build number you are using (don't say "latest" - you'll find a version number in the Update tab of Alfred's preferences)

    Alfred 5.1.1


    * Include your macOS version 

    macOS Monterey 12.6.5

     

    image.thumb.png.b1bab2e885609338e8ee08a14653fc56.png

     

    image.png.b0a9d4a78fc5098cbff2a149e79a9ee7.png

     

    image.thumb.png.de5fdd4cc24a42751bcfcf6a52b4d7bf.png

  2. @vitorsaid I am not allowed to make new posts for this. So I will share my issue here. 

     

    I followed the python install instructions and also reinstalled Git Repos from here: https://github.com/alfredapp/updated-third-party-python2-workflows (so it's on the list that things keep getting added to by folks' requests) however, it still does not work. This is what I get:

    [10:01:27.495] Logging Started...
    [10:01:36.064] ERROR: Git Repos[Script Filter] Code 1: Traceback (most recent call last):
      File "/Users/***/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9B958AD0-679D-4B2D-99D1-B0AF467B03A0/repos.py", line 34, in <module>
        from workflow import Workflow3, ICON_WARNING, ICON_INFO
      File "/Users/***/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9B958AD0-679D-4B2D-99D1-B0AF467B03A0/workflow/__init__.py", line 16, in <module>
        from .workflow import Workflow, manager
      File "/Users/***/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9B958AD0-679D-4B2D-99D1-B0AF467B03A0/workflow/workflow.py", line 25, in <module>
        import cPickle
    ModuleNotFoundError: No module named 'cPickle'
    [10:01:36.180] ERROR: Git Repos[Script Filter] Code 1: Traceback (most recent call last):
      File "/Users/***/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9B958AD0-679D-4B2D-99D1-B0AF467B03A0/repos.py", line 34, in <module>
        from workflow import Workflow3, ICON_WARNING, ICON_INFO
      File "/Users/***/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9B958AD0-679D-4B2D-99D1-B0AF467B03A0/workflow/__init__.py", line 16, in <module>
        from .workflow import Workflow, manager
      File "/Users/***/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9B958AD0-679D-4B2D-99D1-B0AF467B03A0/workflow/workflow.py", line 25, in <module>
        import cPickle
    ModuleNotFoundError: No module named 'cPickle'
    [10:01:36.353] ERROR: Git Repos[Script Filter] Code 1: Traceback (most recent call last):
      File "/Users/***/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9B958AD0-679D-4B2D-99D1-B0AF467B03A0/repos.py", line 34, in <module>
        from workflow import Workflow3, ICON_WARNING, ICON_INFO
      File "/Users/***/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9B958AD0-679D-4B2D-99D1-B0AF467B03A0/workflow/__init__.py", line 16, in <module>
        from .workflow import Workflow, manager
      File "/Users/***/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9B958AD0-679D-4B2D-99D1-B0AF467B03A0/workflow/workflow.py", line 25, in <module>
        import cPickle
    ModuleNotFoundError: No module named 'cPickle'

     

    And @vitor said that, although some of them are on the list, "they may still be missing modules" and thus...may not work, and it may require the attention of the developer ( @deanishe). I am not sure if Deanishe is open to updating these (or already has?) but I know a lot of people use their workflows. 

     

    Also @vitor can you help me understand why it's on that updated list if it's still not working? Maybe it should be moved to a special section ("updated for python fix but still doesnt work due to known issue, contact developer") rather than being listed alongside fixed stuff.

     

    Is there an easy fix to the cPickle issue? I know cPickle was replaced by Pickle, tried changing that throughout the file as a last resort and no dice. 

     

    Sorry if I am breaking 20 million forum rules or saying stuff that's against the etiquette rules here. It is frustrating when half of your workflows stop working. 

  3. Hi there, I think I tried too many python fixing solutions and broke stuff.

     

    I followed this: https://www.alfredapp.com/help/kb/python-2-monterey/

     

    I also reinstalled Git Repos by Deanishe (as an example) from here: https://github.com/alfredapp/updated-third-party-python2-workflows

     

    And I still get no worky. Here's the debug:

    [10:01:27.495] Logging Started...
    [10:01:36.064] ERROR: Git Repos[Script Filter] Code 1: Traceback (most recent call last):
      File "/Users/***/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9B958AD0-679D-4B2D-99D1-B0AF467B03A0/repos.py", line 34, in <module>
        from workflow import Workflow3, ICON_WARNING, ICON_INFO
      File "/Users/***/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9B958AD0-679D-4B2D-99D1-B0AF467B03A0/workflow/__init__.py", line 16, in <module>
        from .workflow import Workflow, manager
      File "/Users/***/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9B958AD0-679D-4B2D-99D1-B0AF467B03A0/workflow/workflow.py", line 25, in <module>
        import cPickle
    ModuleNotFoundError: No module named 'cPickle'
    [10:01:36.180] ERROR: Git Repos[Script Filter] Code 1: Traceback (most recent call last):
      File "/Users/***/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9B958AD0-679D-4B2D-99D1-B0AF467B03A0/repos.py", line 34, in <module>
        from workflow import Workflow3, ICON_WARNING, ICON_INFO
      File "/Users/***/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9B958AD0-679D-4B2D-99D1-B0AF467B03A0/workflow/__init__.py", line 16, in <module>
        from .workflow import Workflow, manager
      File "/Users/***/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9B958AD0-679D-4B2D-99D1-B0AF467B03A0/workflow/workflow.py", line 25, in <module>
        import cPickle
    ModuleNotFoundError: No module named 'cPickle'
    [10:01:36.353] ERROR: Git Repos[Script Filter] Code 1: Traceback (most recent call last):
      File "/Users/***/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9B958AD0-679D-4B2D-99D1-B0AF467B03A0/repos.py", line 34, in <module>
        from workflow import Workflow3, ICON_WARNING, ICON_INFO
      File "/Users/***/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9B958AD0-679D-4B2D-99D1-B0AF467B03A0/workflow/__init__.py", line 16, in <module>
        from .workflow import Workflow, manager
      File "/Users/***/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9B958AD0-679D-4B2D-99D1-B0AF467B03A0/workflow/workflow.py", line 25, in <module>
        import cPickle
    ModuleNotFoundError: No module named 'cPickle'

     

    Let me know what other info I can provide.

  4. @deanisheThank you so much for taking the time to write that. It worked perfectly, and I know I will get further use out of it in future workflows. 

     

    I am posting my final workflow here for anyone interested in importing one snippet to Alfred. 

     

    Background

    I often use this method (Github link) which works to BULK-import snippets into Alfred using a csv. But oftentimes, I'm going about my day and I find that there's a single snippet I'd like to save. It always feels unnecessarily cumbersome to have to open alfred and navigate to the Snippets area and click around to add a single snippet.

     

    This workflow

    This workflow allows you to invoke Alfred and create a single new snippet directly from the Alfred entry window.

     

    Entry:

    There are two methods:

    A ) You can enter a comma delimited string for snippet,name,value all at once.

    B ) You are prompted step by step for snippet, name, and value.

     

    Folder selection:

    It prompts you to choose which preexisting snippets folder you want to save it in (it's possible you may need to change the snippets directory in the Script Filter). This uses the lovely script written by @deanishe above.

     

    Snippet creation:

    It creates a json file within the appropriate folder. A random identifier is required within the file itself and as part of the filename, so you'll see some random variable cleanup happening in the workflow.

     

    Reveal:

    For fun and validation, it reveals to you the snippet file in Finder (delete this step if not needed).

     

    Using the snippet:

    I found through testing that the snippet is not immediately available for use after it's created. It appeared eventually, but after I checked immediately and it wasn't able to be called in the snippets window, I checked again and it was there like ~10 minutes later. My guess is that Alfred loads its snippets on startup, or periodically, or by manual interaction with the snippets preferences (idk). So, the last step in this workflow restarts Alfred in case you want to use it immediately. If this step is found to be annoying, or if you don't think you will need the snippet immediately (it's probably on your clipboard :)) this step can be removed. 

    The script used here is from:

     

    Download this workflow:

    https://drive.google.com/file/d/1Oe1XXViYe2fHWTgQqRvjT7KeUEAEwzBf/view?usp=sharing

     

    Disclaimer:

    This workflow is not perfect and could definitely be streamlined (e.g., the random variable cleanup might not be necessary, maybe there's something less aggressive than restarting Alfred). Also sorry if I didn't follow layout best practices for long workflows, I couldn't find what they are and tried to make it as neat as I could.

  5. @deanisheThank you so much for taking a look! Ahh, so I think what I am after then is a list filter or a script filter, because I do want to be presented with a list of the 10 folders to choose from. That's where my confusion was. Said another way, the first 4 vars are set completely anew while the 5th var would be chosen from a group and I don't always remember what the group has without seeing the list.

     

    What would be the best way to combine the simplicity of that file filter (return all of the child folders inside a static parent folder) with the list-showing capabilities of a list or script filter? 

     

     

  6. Hi there, I've searched and searched, and I feel like I'm close, but can't quite get there. 

     

    I have a workflow that uses Write a Text File, and I want to save it to a dynamic location within a specific scope. 

     

    For example, I have a parent folder with 10 children folders inside. I'd like to be presented with the 10 children folders, select one, that child folder gets saved as a variable, and then my Write Text File action gets saved to /{var:childfolder}/name.txt

     

    I have used Dynamic File Search and File Filter to get me to the right place, I just want to save the folder as a variable, to be used shortly, not open the folder.

     

  7. Thanks @deanishe. I searched all day on Saturday and could not find what I was looking for -- There are many that do the link formatting that I want, but it's all the active browser tab, rather than referencing bookmarks. And in fact, I would probably not be using this workflow while IN the browser, I would normally be using it in Omnifocus. I wasn't sure how to modify those workflows (that do the url/title part I'm looking for) to be referencing a queried bookmark. 

     

    I wasn't sure if my approach should be to combine something like this: http://www.packal.org/workflow/chrome-bookmarks-0 with something like this: https://github.com/esanai/lazylink and at what exact point should they be combined.

     

    What I'm stuck on is that one part is a script filter (the querying I want to do in alfred) and then another one is running a script (making the link). It's almost like a file action...but not on a file?

     

    Edit:

     

    The lazylink script works because, in the active browser, it defines link title as document.title. In my browser bookmarks file, the title and link are "name" and "url" in a json object. So I think I would need a script filter that searches the bookmarks file, like the one I linked above. And then run a script that parses out the json title and url and then formats that into a link (which lazylink has). I feel like I'm so close!

     

     

     

    Screen Shot 2021-05-04 at 9.51.25 AM.jpg

  8. I love that I can search bookmarks in alfred natively! I discovered that I can copy the url of the bookmark to clipboard by just using CTRL-C.

     

    Now I am hoping to create a workflow to copy the bookmark's TITLE AND URL to clipboard. Whether in markdown format, or formatted as a rich text link, or just A and then B. 

     

    How do i access the bookmark's title to be able to accomplish this?

  9. Hi there, I'm hoping to add a follow-on question here. Ctrl-C does work on the selected result to copy the URL -- what I am looking for is a way to copy the URL and Title

     

    Sort of like the below. There seem to be lots of alfred workflows to grab the URL and title from a chrome browser-- but i'm looking to do it from an alfred web result (mainly: my chrome bookmarks that i'm searching that i need to paste a formatted link to elsewhere)

     

     

×
×
  • Create New...