Jump to content

deanishe

Member
  • Posts

    8,759
  • Joined

  • Last visited

  • Days Won

    522

Everything posted by deanishe

  1. You should have searched the forum… Apple removed /usr/bin/python in the last minor release of macOS. The forum is full of messages about broken Python workflows. You can't symlink to /usr/bin unless you turn off the SIP security system (not recommended). The long and short of it is, you or somebody else will probably have to port the workflow to Python 3
  2. The only people who think that are the ones who think developer convenience trumps user convenience. I do not. I think asking normal users to unnecessarily install developer tools is very poor practice. People should of course feel free to use whichever languages they want (it’s their time, not mine), but please do not minimise the huge inconvenience of asking regular, non-technical users to install developer tools. Go read any of the threads for Node-based workflows that aren't aimed at developers and see all the fun it leads to. A pretty minor change? No non-trivial Python 2 program runs unchanged under Python 3. The one, massive, break-the-world change in Python 3 was how text processing works, which is most of what workflows do. Yes, yes they did. But there was still nothing minor about the change.
  3. @xilopaint You should open an issue on the library's bug tracker. It claims to support 3.7+. Also, like Vítor says, there is no Python 3 on macOS by default, so I wouldn't sweat over using a Homebrew Python instead of an Apple one. The Apple one is slightly preferable, as the devtools are easier to install than Homebrew.
  4. Just google any porting guide. Python 3 has been around since 2008 (though I’d argue it wasn’t usable till a decade later…), so there’s plenty of material available. In most cases, you might need to change a couple of import statements, but the majority of the work will be rewriting the string processing. Seeing as this is the meat-and-potatoes of what most workflows do, many ports will end up closer to rewrites.
  5. Python 3 isn't actually there on a normal system. It's part of Apple's developer tools. So you can't just add /usr/bin/python3 to the dropdown list.
  6. That's because Apple never bothered to include Python 3 with macOS. But sure, blame workflow developers for using the tools Apple gave them.
  7. Alfred normalises Unicode to NFD form before passing it to scripts. If you need the raw input as entered by the user, tell Alfred to write it to a text file and read it from there.
  8. That's highly dependent. With a good connection and not too many files, sure. But if Dropbox just started up and is still scanning all your files, it can take some time for changes to sync. Using remote server-based software to sync between two local accounts seems highly sub-optimal, too. Or does LAN sync also work between two clients running on the same machine?
  9. Hi @adross, welcome to the forum. Your question isn't about Alfred, it's about your browser. It's possible that someone can help you, anyway, but you haven't even told us which browser you're talking about…
  10. It's not a standard package, so you should bundle it with the workflow. Asking non-technical users to install software libraries when you could easily bundle them isn't great. And, that's not a great way to install requests, either. You should always call pip via /path/to/python -m pip, so you know which Python you’re installing the packages in. There’s no telling what will get called if you just run pip because different Pythons all want to use /usr/local/bin/pip and will overwrite each other. Alfred also doesn’t use the same PATH as your shell, so python won’t be the same command in Alfred as in a shell. So use the full path to the Python executable. Finally, you shouldn’t install packages globally like that. Install them in your user-specific library folder, so you aren’t changing the system and don’t need admin rights: /path/to/python -m pip install --user requests
  11. It's "JXA", not "JXE". JavaScript for Automation. To return JSON from a JXA script, you usually want return JSON.stringify(myResultsObject) in your run function.
  12. PID is an ideal one for this case. Let the OS guarantee the uniqueness. I’d also recommend this technique (caching a value in an environment variable) for passwords stored in Keychain. Calling /usr/bin/security is slow, but you don’t want to store passwords in plaintext. So do password = get_env_var('varname') or get_and_export_keychain_password('account name', 'varname') to ensure /usr/bin/security is only called once instead of every time the Script Filter is run.
  13. Could you explain what problem this solves? I mean, it's trivial (and preferable) to truncate your array of results before sending them to Alfred if you only want to show N results. Why isn't that an acceptable solution? What's the issue with there being a lot of (possibly) unwanted results off screen below the top nine? Alfred can handle tens of thousands of items no problem, so performance can't be the issue.
  14. As a rule, the solution Vítor suggested (altering PATH) is a much better one. Adjusting the local environment to a script is preferable to hardcoding a script to a specific environment.
  15. Yes, it can be. For folders you access very regularly, it's worth adding a workflow with a Keyword for each one. It works much more reliably than Alfred's File Search.
  16. You can't unless the workflow you're trying to get information out of explicitly supports it. External Triggers are the official way to call other workflows, but they're one-way only, so the workflow you're calling would need to be able to pass the results to an arbitrary External Trigger, and you would have to tell it to "call you back". Much like the way x-callback-url works.
  17. Did you find any APIs that allow you to send files to a specific iOS app from a different machine? If you did, then it may be possible. If you didn't, then it probably isn't.
  18. No idea, tbh. If you already have a script, you can open the files with /usr/bin/open -a ApplicationName /path/to/file /path/to/other/file instead.
  19. It's possible, but a lot of hard work. Alfred only knows how to search for files (and contacts). Anything else you would have to implement in a workflow, or write some software to create proxy files for all your applications' bookmarks, notes etc.
  20. Alfred can't do it, no, but you can use an application specifically designed for this kind of thing, like Choosy, to open specific URLs in a particular browser (profile). I'd say that's your best bet. I don't see Alfred ever implementing such a niche feature.
  21. Sounds like you've set it up wrong. If the keyword is "foo", Alfred should run the Script Filter (and show its results) as soon as you type "foo" (or "foo " if you've checked "with space"). Have you set it to "Argument Required"? That would explain why it's not running immediately.
  22. That’s basically static JSON, which can easily be emitted from a shell script, too. Node does seem like overkill for this, but seeing as it’s an npx workflow, so Node needs to be installed anyway, why not? JavaScript is easier to read than shell.
  23. "Memory used" is a largely meaningless statistic because macOS doesn't purge anything from RAM until it needs the space for something else. The RAM should nearly always be full (unless you have like 128GB or something). Look at the "memory pressure" to see if you actually have too little RAM.
  24. It should be something like $dueDate = date('Y-m-d\TH:M:s'); Timezone is configured in PHP settings, IIRC.
×
×
  • Create New...