Jump to content

macrospect

Member
  • Posts

    39
  • Joined

  • Last visited

Reputation Activity

  1. Like
    macrospect got a reaction from vitor in Workflow to list contents of a folder in Alfred window?   
    Brilliant! Thank you, @vitor. I somehow never found the Folder Contents Automation Task. And I never even would've thought to use a grid view. The workflow you linked to is fabulous, and both options work like a charm. 
     
    I will check out the starting guide more thoroughly this summer. Every time I start looking at it, I seem to know everything I read—but I'm clearly missing many parts. Alfred is such a capable app! 
  2. Thanks
    macrospect reacted to lehcar3 in Write Text File to folder selected from list   
    @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.
  3. Like
    macrospect got a reaction from Pearcen in Text processing by keyword   
    Yes, perfect fix! @Pearcen's workflow does exactly what the original poster wanted (it switches dashes/hyphens to spaces in selected text using a universal action, and I just reversed it to switch spaces to hyphens for my own purposes). In case the link ever breaks, here's how to reconstruct it as a manual workflow: 
     
    Trigger: Universal action and/or hotkey (with argument "Selection in MacOS")
    Utility: Replace regex - with  ␣ [I reversed this for the conversion of space to hyphen instead]
    Output: Copy to Clipboard (with paste to frontmost app checked) [I also checked make transient on clipboard]
     
    Thank you so much, Pearcen and @Stephen_C! You saved me a ton of time.
  4. Like
    macrospect got a reaction from Stephen_C in Workflow for printer status?   
    Fabulous, that works perfectly. Thank you, Stephen and Giovanni!
×
×
  • Create New...