Jump to content

deanishe

Member
  • Posts

    8,759
  • Joined

  • Last visited

  • Days Won

    522

Everything posted by deanishe

  1. Sure: the File Filter isn't run until you action the Keyword to pass control to it. As long as the Keyword doesn't require an argument, you can hit ↩ immediately to go straight to the File Filter. But if you want live feedback immediately, you need to duplicate the File Filter.
  2. I can't, no. Your script references paths and programs that don't exist on my system. Quote your variables and subshells—var="$(command here)"—properly.
  3. That's to be expected. The only variable you've quoted is $downloaded_file.
  4. Dude, that's literally what I just described. Setting an environment variable is the standard way to tell a program it's being run from another program. That or a command-line option.
  5. The problem is that you're trying to store two values in one variable. When your first Keyword element finishes, {query} = 25. Your Run NSAppleScript element immediately overwrites this with the YouTube URL, so {query} = https://www.youtube.com/… You need to insert an Args and Vars Utility after the trim Keyword to save the user input to a different variable. Here is a working version with the above changes.
  6. You've just kinda run into one… The bottom line is that those alfred_* variables should only exist in a (test) workflow environment. In part because some are specific to one workflow, and also because checking for the existence of one of the variables is the obvious (and only practical) way for code to tell if it's running in an Alfred workflow or not. That may never have been a problem until today, but it is a misconfiguration waiting to cause an issue. The open command can pass arguments to a command. It's semantics are the same as the way Alfred opens things, too (i.e. via launchd).
  7. Oh yeah, that would do it. You might want to consider using Alfred's (macOS's) built-in method for opening apps—or using env -i—so as not to inherit the workflow's environment. This is something that annoys me about macOS. I wish your entire user session were bootstrapped from a shell, like on Linux. Very annoying for developers.
  8. To add to what Vítor said, you’re having a problem with some non-standard software: Node. That is to say, this isn’t purely an Alfred question. It’s quite possibly an issue with your own system that we can’t possibly replicate. That’s the risk in using workflows written in things like Node. If you have a choice, it’s always safer to go with a workflow that’s “native” to macOS rather than one that requires non-standard platforms like Node. Indeed, Node is particularly bad, as Node devs often have a brain-damaged approach to writing workflows.
  9. Alfred just asks the system (or app) to open a URL. *How* the URL is opened is the application’s business. If you’re using Safari, for example, how URLs from other apps are opened is configured in Safari’s settings. If you don’t want URLs from Alfred opened in the application’s default manner, you’ll need to use the app’s scripting interface to make it behave the way you want.
  10. Then you’ve screwed up your shell environment. You should *not* be setting Alfred’s variables in your normal bash environment. Only if you need to run a workflow script that will otherwise fail outside of Alfred, i.e. you’re developing a workflow. For my part, I use the autoenv plugin for zsh to ensure such variables are only set when I’m in a workflow’s repo and are immediately unset when I leave that directory.
  11. If you just need to check whether your script is running in Alfred or not, check for the existence of one of the environment variables Alfred sets, e.g. alfred_version. If it's set, your script is running in Alfred.
  12. Gah! Tell me about it. And now some clowns have started to call the Python 3 executable python instead of python3.
  13. Download the v2 beta and set GOOGLE_PLACES_API_KEY in the workflow's settings sheet.
  14. Nothing is being passed out to the rest of your workflow. That isn't the same as sending a query to Alfred itself, which is what you're doing. Essentially, what the text means is "the rest of your workflow won't be run." If you want an empty query box, change Argument to None.
  15. Have you considered putting your workflows on GitHub or similar (with source code)? Nofile, Dropbox etc. are better suited for throwaway workflows, IMO, which isn’t a description that applies to your stuff. A “proper” host makes it easier for folks to find the latest version, too.
  16. I’m sure you’re right. I was just looking at the code in info.plist on my iPad, so I didn’t have any real context. I also can’t remember whether Andrew added PYTHONIOENCODING to Alfred, which would affect the behaviour. Weird that it would want NFC considering macOS prefers NFD.
  17. English, too, tbh. The workflow is failing because it’s trying to use encoded strings, but Python’s json module is Unicode. So it dies in flames when given non-ASCII input. At minimum, every query variable needs decoding. Ideally, all Python strings should be converted to Unicode strings, not encoded strings.
  18. Open the folder in Finder first to make it recently used, then try again.
  19. Like I said, choose that folder a few times for the query "my".
  20. Are you a Powerpack user? It might be a Powerpack-only feature.
  21. Give me a day or two. I need to update the workflow library now Alfred has a real way to change options. But first, I need to upgrade a machine to High Sierra, as GitHub have changed their SSL settings, breaking Python on El Cap and Sierra.
  22. You've missed the important part in your screenshot:
×
×
  • Create New...