Jump to content


Community Hero
  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by vitor

  1. There is plenty wrong with Bash, but nothing wrong with you using it. It’s an idiosyncratic but capable glue language that I still use regularly. You can find it pretty much everywhere and be sure it will work with some consistency. But the way you’re writing it could indeed be improved upon. It makes little sense to keep escaping double quotes when you can use single quotes. Also, there’s no need for printf '%s\n' or so many of them. A single echo (or a Here Document) suffices. Your code isn’t working because Dynamic Placeholders aren‘t meant to be used in Alfred’s non-code areas. It wouldn’t be wise for Alfred to replace them everywhere and risk breaking your code. As a workaround, you may connect a Keyword Input to an Argument and Variables Utility that saves the clipboard contents as variables to be used in the Script Filter. Be aware that there is bound to be some breakage when the raw clipboard contents interact with the code, such as when you have a quotation mark in the clipboard. That is why raw Bash is not a good choice in this case — you need to sanitise your input beforehand, and libraries are good for that. Here’s a ready-made Workflow. I’ve kept and fixed the Bash example so you can still reference how your code could have been, but the end result uses Ruby. Finally I’ll ask that in the future, when asking for help with a Workflow, please upload it somewhere as it’s hard to help without access to it. Debugging can already be hard with access to the code, even harder to do so by guessing from a description. There are multiple places where the code or Workflow setup can be wrong. Without looking at it we’re mostly shooting in the dark. The Reporting Problems with Workflows topic gives a nice overview on how to build an effective report.
  2. Welcome @llanito, Further information will be required to diagnose your problem. Please read the following post on how to write an effective bug report.
  3. I was away for a few days, but I’m looking at this again. That’s on purpose and won’t be changed any time soon. There’s a discrepancy between what youtube-dl reports it will download and what it really does given best. I’ve decided on downloading “the best mp4” because in my tests it was a more common format and more useful on macOS (can be previewed with QuickLook). audio_format only affects audio-only downloads. That’s a good point. For everyone with an issue, do you have custom download_dir or watchlist_download_dir values (Workfow Environment Variables)? What are they? If you delete them, does the issue go away? Paths should be absolute or use ~ to represent the home directory (e.g. ~/Downloads). It may be worth to delete and redownload the Workflow but tell Alfred to not import the previous settings. DownVid won’t auto-update without telling you, but the underlying youtube-dl might. After this post, who still has an issue?
  4. The one I linked previously. When you add an External Trigger, Alfred shows you the sample AppleScript code you need to invoke. How you call the AppleScript is up to you. If you were doing it in a Terminal, you’d do something like osascript -e 'CODE HERE'.
  5. I should’ve been clearer — there’s no URL scheme you can use, the only way to do it is via AppleScript.
  6. Welcome @Uhnnohn, What you’re looking for are External Triggers.
  7. Welcome @BlitzKraft, How are you opening Alfred? That isn’t the standard window where you can input commands.
  8. Alfred Preferences → Features → Snippets → Auto expansion options → Tweaking → Simulated key event speed (make it slower).
  9. Welcome @and1, Could you please clarify your request? I have no idea what you’re asking about.
  10. Thank you. The app always show the remaining timer in the menubar, a notification would be repeated information. Unless, I guess, if you’re using an app in full screen. I’ll think about it, but make no promises.
  11. This isn’t a bug in Alfred, but in the Workflow. It’s at its source that you need to report it.
  12. _sharedresources exports the PATH inside the script it runs as /usr/local/bin:"${shared_resources_bin}":"${PATH}". In theory, if the original PATH was empty the new one would lack /usr/bin/, where sed and friends live, and possibly other important system paths. Which is why I suggested looking for the tools via which in a terminal. But I see no reason why Alfred would be passing an empty PATH, and to only a few people. Either way, the problem would still lie outside the Workflow. I could check what PATH Alfred uses and set it directly in _sharedresouces, but I dislike that solution from a coding and future-proofing perspective.
  13. Update. When opening bookmark in Pinboard, remove the protocol from the search. To update, download the latest version (same URL) or wait a few days and it’ll prompt you to on next usage, since it uses OneUpdater.
  14. Try deleting the directory, not the files inside.
  15. I may be wrong, but at least sed’s message should include the path, that being the case (sed: /some/path: No such file or directory). I don’t know, but two people experiencing it has me on alert that the error may not be where I think it is. I have an idea where the problem may be, but not the cause. @jwz @s95hc8 If you open a terminal and try: which sed which awk which youtube-dl What are the results?
  16. I can’t watch or download the video. The connection always stops at some point.
  17. Welcome @liujl, A few tips regarding the obfuscation in your screenshots: None of those have any identifiable information. There’s no point in obfuscating things that are the same for everyone, such as the names of “Microphone”, “Accessibility”, and “Full Disk Access”. The amount of pixelisation you used is not enough to be useful. The Bartender and Dash icons are still recognisable, particularly in a community such as this one where people care about such tools. The ID in the name of the Workflow directory is random; it contains no identifiable information. Never use pixelisation if you care about obfuscation. There are tools that can deduce the original contents with surprising accuracy. As to your problem, that seems like a permissions issue. Right click the Workflow’s name in the list and “Open in Finder”. Can you delete the directory? Does the action ask for a password?
  18. @s95hc8 Looks like you’re having the same issue as @jwz
  19. The “Don’t close the Alfred window on actioning result” Window Behaviour option choice is always a hard one for me. I have multiple nodes in multiple Workflow where I want both behaviours at different times. One way to achieve this is to add a new connection with a modifier that performs the opposite behaviour. This is hacky at best, and needs to be added manually each time to each specific option. My suggestion is a new behaviour with a global shortcut. Let’s say we’re on a result window that typically closes when picking a result. We double press ⌘ (or any other shortcut) and get a small padlock on the top right (I’ve used icons from my Workflows because I had them on hand). The window will stay in the “Don’t close the Alfred window on actioning result” mode until we dismiss it, at which point everything goes back to normal.
  20. Don’t say “does not do anything”. That gives zero information to debug your problem. Instead, describe your steps and what happened — which is unlikely to be “nothing”, there’s almost always something, just not what you expected. How did you start the Workflow? What command did you use? You can’t “start the Workflow on a Youtube page” because that’s not how it works. You need to copy URL to the clipboard and then call the Workflow. That’s explained in the first lines of the README. What do you mean, “after a while”? It’s normal for that message to appear after a download ends. For me to be able to help you, I’ll need detailed steps and the debugger output (set to “All Information”).
  21. Update. Added External Trigger. To update, download the latest version (same URL) or wait a few days and it’ll prompt you to on next usage, since it uses OneUpdater.
  22. If the Terminal in question supports doing so via AppleScript, yes by setting the custom terminal integration. To get the exact code, you may wait for someone on the forum or try Ask Different.
  23. Then the file type doesn’t matter. That’s what I’m saying: you can tell an application to reveal a document in the Finder, it doesn’t matter what it is. And since you’re telling the application, you can’t have a generic solution, you’d have to include specific grammar for specific apps.
  24. No. The application in question needs to support AppleScript and applications can have whatever grammar they want. There’s no generic solution to to your question.
  25. Update. Fix deleting paths with single quotes. To update, download the latest version (same URL) or wait a few days and it’ll prompt you to on next usage, since it uses OneUpdater.
  • Create New...