Jump to content

vitor

Staff
  • Posts

    8,511
  • Joined

  • Last visited

  • Days Won

    708

Everything posted by vitor

  1. Yep. Pretty much. The workaround might be different because Homebrew no longer ships Python 2 in the core tap. As for its impact on Workflows, we’ll have to wait and see. (In the grand scheme) There weren’t that many popular ones written in PHP and still working, and for a while now new Python Workflows (that I’m aware of) have required Python 3, meaning many people won’t even notice. @deanishe’s older Workflows (and Workflows using his library) may be affected because (unless I’m misremembering) his Workflows always used the builtin-in Python (thumbs up; no dependencies and fewer instructions) until he abandoned it for Go.
  2. @nesdroc Thank you for the kind words. I cannot reproduce the problem, so my post right above yours still applies.
  3. It’s literally pasting that code without changes. Follow my instructions and the resulting Run Script object will take your input and spit out the encoded text for the next object, just like if it were another utility.
  4. Shortcuts doesn’t exist on Big Sur. No idea why Skype wants to handle that file extension on your machine, but that’s not something I have control over. This older version of the Workflow works on Big Sur.
  5. Yes. Python’s transition has nothing to do with Apple and that change isn’t news. Though it is bad form of them to do the deprecation in a point release rather that a major release.
  6. You may also be interested in External Script as the Language. It’s the square to the left of Cancel.
  7. That’s a feature of the language. It wouldn’t make sense to have it as part of the UI because it’s a piece of code like any other.
  8. It depends on your Workflow. By using a Run Script Action with Language /usr/bin/osascript (JavaScript), you can encode the input with function run(argv) { return encodeURIComponent(argv[0]) } Or, if you know the only thing you will need to encode are the spaces, use a Replace Utility.
  9. Currently there is no way to do it. This is a duplicate, so please continue the conversation in the original post if you have anything else to add.
  10. Don’t make your password available in plaintext for every app to see. You can restart without a password by using an AppleScript Run Script Action with tell application "System Events" to restart, or better yet just use a System Commands Action.
  11. Save the bash script to the Workflow’s root directory, then just source script_name before calling your functions.
  12. The transition from Python 2 to 3 took over a decade and is extremely well-known (in the whole field) for how annoying it was. Even basic tutorials these days are likely to mention it. If it was news to you, that is both a fluke and good news. That would be clutter. It is the purview of the person programming to determine that because it depends. It isn’t hard at all and you figured it out. That is good, and if you plan on writing more code you absolutely must get used to it. From here on out it only becomes more complex and there is no handholding. Learning how to understand what’s happening and how to fix it will be a crucial skill. I don’t believe that. You did figure it out. Right on the first post you mention the different versions! Then you took the correct next step: tried to fix it yourself and asked for help when you felt you were at your limit. Good job! Now you’re programming; that’s all part of it. Do you think I or Dean never have questions? Everyone relies on other people sometimes. I didn’t want to overwhelm you on the first reply and do think that at this point you’ll benefit from experimenting and making mistakes, but the fixes we offered you are documented. At some point in the near future it will be useful for you to understand that model. The situation isn’t as clear-cut as that. Try Ruby in the Terminal and you’ll get a scary message too. Should Alfred also warn about that? Definitely not! The only reason the message exists is Apple put it there. We didn’t need to be in this situation; we are because they chose it. It’s irrelevant to discuss that at this point. The Alfred community has known of these deprecations from the start and the path forward is implementing a solution, not adding caveats to the old method.
  13. It definitely is. I made that one over three years ago.
  14. @gohoyer That solution takes the long way around and uses a deprecated tool. @donnoating mentioned they know how to do it with launchd; that’s the correct and most straightforward tool for the job—it’s even recommended in the link you posted.
  15. And you’ll have to. By design, Alfred Workflows have to be purposely called, there’s no facility to auto-run them on their own.
  16. You can do it from Alfred, yes, but it will require a bit of coding. We can help you with that. If you’re not comfortable with coding, you’ll have to share every step in as much detail as possible for us to be able to help. For example, the exact source of that directory and where everything is going to be saved. I don’t know what that is. Can you describe it another way and/or with images? Never say you’re on the latest; always specify the exact version. We don’t know if “latest” means the latest beta or stable or if you think you’re up to date but are mistaken. Furthermore, people who bump into your post in the future won’t know if it applies to them. That’s more relevant for debugging, though, it doesn’t matter as much in this case.
  17. From the documentation: In theory it should work because you’re telling Google Drive to keep that directory locally. In practice, Google Drive File Stream is known to be problematic on macOS.
  18. That’s not an oddity of your system, it’s expected. It isn’t worth going into the Python 2/3 kerfuffle here but don’t expect that to ever be updated on macOS. Apple is actively removing scripting languages and no longer updates them. Because you’re using Python3 features. macOS has never shipped Python3, though it installs it with the developer tools. Yes, but you can’t paste the script into the box. There are a few ways to do it; one is to set it as /bin/bash then /full/path/to/python3 /path/to/your/script. Note that using Python3 currently makes your Workflow harder to share, which you may or not care about. There are plenty of Python3 Workflows shared on the forum (e.g. by @Acidham) so look at those for ideas.
  19. @realliyifei See https://github.com/deanishe/awgo/wiki/Catalina
  20. It does! See Script Filter JSON Format and search for variables. You make them at the top level or per item. It’s what I deduced above: "arg": ["Offensichtlichen Effekt","abcdefg"] means there are two arguments: the first is Offensichtlichen Effekt and the second abcdefg. None of them has a comma in it, so there is no splitting. Try instead "arg": "Offensichtlichen Effekt,abcdefg" (one argument, with a comma) or add a comma anywhere inside the quotes for one of the arguments and it will work.
  21. They aren’t dropped; they aren’t there to begin with. The other shows it because there is a space and it makes clear it’s a single entry. That isn’t relevant, thought. We can’t say for sure unless you share (a simplified version of) your Workflow, and ideally explain what you’re trying to accomplish. Debugging is already hard with access to code, and you’re asking us to do it from an incomplete description. We don’t even know what’s the character you’re splitting on. Are you trying to split on commas? Because there are no commas in your output. And you’re sending two arguments, not one. Why are you using the splitting utility? If you’re outputting from a Script Filter anyway, define the variables there. Or use the arguments directly. Again, it’s impossible to say the best course of action (but it’s likely not splitting the argument) without context.
  22. If I’m understanding correctly, what you want is a Run Script Action with language /usr/bin/osascript (JavaScript) and code: function run(argv) { return decodeURIComponent(argv[0].split("?url=")[1].split('&')[0]) } That will take whatever argument you passed early (e.g. from a Keyword Input), transform it, and output it to the next Alfred object.
  23. Moderator’s note update to link to Troubleshooting File Indexing Issues on macOS Monterey instead.
×
×
  • Create New...