Jump to content

Gary King

Member
  • Posts

    108
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Gary King

  1. Is there any problems with having the Alfred env vars exist in my shell? Or it just leads to possible "confusion", such as if my script is trying to read an Alfred env var, then the value would possibly be incorrect? The reason I open apps like Terminal via a workflow using system commands (os.system in Python) rather than Alfred's method, is because I usually also need to pass args to the commands. And depending on the keywords used, a different app would be opened, etc.
  2. I'm not sure how the Alfred env vars ended up in my Bash env. I have a workflow called "Finder" on my Mac, which contains several File Filters that I use to look for specific file types in different folders. That's the one whose Alfred env vars appear in my Bash, such as "alfred_workflow_uid" and "alfred_workflow_name". "alfred_workflow_bundleid" is not set though. I don't know where these vars are being set. I looked in the usual places like ~/.bash_profile, ~/.bashrc, etc. but couldn't find them. --- Upon further inspection, I think I know why the Alfred env vars appear in Bash. What happens is that I have an Alfred workflow that opens iTerm, and therefore when I open iTerm with this workflow, the env vars are set. If I open iTerm through the Dock, then no Alfred env vars are set. So it seems to simply be working normally.
  3. Thanks, but this variable also exists when I run the script outside of Alfred. Looking at `env` in Bash, I actually have a ton of Alfred variables already set there. I found a few `alfred_` keys that exist only in the workflow though, so I'll use one of those other ones.
  4. Is there an environment variable that Alfred sets, that indicates that it's running a script in a workflow? I'd like to use this variable to set the script's environment to "production" when it's set, and to "development" when not.
  5. Thanks for the example workflow. I suppose it is not possible to have live updating results when using the File Filter this way? For instance, normally if you change your input keyword, then the results would change to use your new keyword. But with this workflow, you only get results once you submit your keyword to the File Filter.
  6. I have two File Filters that are similar. They each essentially return the same file types from the same folder, except for a few file type differences. One keyword is "p" and the other is "pr". If I type "pr test" then I have some results appear, as expected. if I delete the "r" from the keyword so that it appears as "p test", then no results appear. I have to modify the search, such as by simply adding a space somewhere, before results appear correctly for "p test".
  7. The file filter placeholder shows if I type the keyword, as expected, but then no results are returned when I type the query, correct. I have the same problem even after hiding and re-showing Alfred.
  8. I have a File Filter to look for specific file types in a specific folder. If I create a new file in this folder that matches these requirements, then use the File Filter keyword to look for this new file, then the new file does not appear. I have to restart Alfred before the new file appears. Yet, I can find the file just fine immediately in Spotlight and Alfred's normal file search. What can I do so that I don't have to restart Alfred whenever I add a new file?
  9. Okay thanks. I didn't know that worked. It definitely isn't intuitive, unless shown for the first time. The "keyword" field in "file filter" should probably be greyed out if it's receiving its input from elsewhere.
  10. I'm not sure how this is supposed to be done then? I have attached screenshots showing what I have. I created a test workflow, with one Keyword leading to one File Filter. If I type "test asdf" in Alfred and hit Enter, it leads to "asdf" as the only keyword in Alfred, with no result.
  11. Thanks for the response. However, doesn't the File Filter need a keyword though? How do I create a keyword, which leads to a variable, which leads to a File Filter, if the File Filter itself needs a keyword and a search query, which will then filter the contents of the folder with the query?
  12. I have several keywords for file filters, that lead to several outputs. The file filters are all actually the same; it's just the keywords and outputs that are different. Is it possible at all to share the same file filter among several keywords and outputs, so I don't duplicate the filter? Since if I ever need to change it, then I have to modify it for every occurrence, rather than just a single one, which would make it much easier.
  13. Is it possible to prioritize one file extension over another in the results, without hiding results for the secondary file extension completely? And without creating separate searches for the two extensions?
  14. Ah excellent thanks. It isn't clear at first that this is the way to go, since I rarely use those fields in the JSON output, but they are indeed very useful here.
  15. I'd like to create a Script Filter, where when the user selects an option, then the current Alfred keyword is replaced with a new one. So for instance, the user types in "test " (with a space at the end), and then the script shows the options dropdown, and the user picks one and hits Enter, then the keyword now shows "test one", and my script will then show a new set of options. How can I do this with Alfred? Is it possible to do by connecting one Script Filter to another? Thanks!
  16. Is it possible to have just one script in an Alfred workflow, as a Script Filter, then when the user chooses an option, it will pass it through the same script, and based on the argument, either show new results, or open a URL? So, the part I need help with is making it possible to infinitely pass the argument into the same script, without of course creating an infinite number of Script Filter objects in the workflow. This would easy if, say, I just needed the user to choose two options, then I'd just have two Script Filters, but that's not the case here. Thanks!
  17. If I have a Finder window open and in focus, how can I get that folder's location in a workflow that I run in Alfred? Is it possible at all? Either within Alfred or via any programming language?
  18. I increased it to the max at 0.9s but still doesn't work.
  19. I have "Restore clipboard content" set to the default, which is checkmarked and at 0.5s. Yet the clipboard is never restored. I copy "test", paste it a few times in a text file to ensure it's in the clipboard. Then open Alfred and type "sn <keyword>" to paste one of my snippets. The snippet is pasted into the text file. Then I wait a few seconds. Then I paste the clipboard's contents, and it's the Alfred snippet, not what I had before.
  20. This seems to only work if I have also enabled the feature to automatically expand snippets. What about if I paste snippets using the "sn" keyword in Alfred?
  21. How can I prevent pasted snippets from being copied to the clipboard?
  22. Strangely enough it doesn't always happen. Sometimes only the URL I requested appears, and no other blank tabs. But if someone could shed some insight into why this occasionally happens, that'd be much appreciated!
  23. I use Firefox as my default browser. However, some websites I only want to open in Chrome, so I setup a keyword for them, which opens the URL in Chrome. When Chrome isn't running and I run the keyword, Chrome opens two windows. One window has the URL I want, and the other window is just a blank tab. Why does Alfred open two Chrome windows? Is there a way to prevent the blank window from opening?
×
×
  • Create New...