Jump to content

vitor

Staff
  • Posts

    8,479
  • Joined

  • Last visited

  • Days Won

    707

Everything posted by vitor

  1. @samdale67 When asking about an existing Workflow, please use its own forum thread. It’s luck that I saw your post. I have moved it to the correct place. As to your question, the answer is covered right at the top.
  2. Sometimes when working in a Terminal you may want to interact with files via a workflow. Alfred supports AppleScript, so an External Trigger is the perfect solution for something you use often. But what if you want quick access to all available Universal Actions? That’s easy too. Add the following to your ~/.zshrc, and you’ll be able to trigger the Universal Actions window from a Terminal by executing ua followed by the desired file paths. function ua { # Verify all paths are valid for file_path in "${@}" do if [[ ! -e "${file_path}" ]] then echo "Path does not exist: ${file_path}" >&2 return 1 fi done # Expand arguments into full paths local -r absolute_paths=("${(@f)$(realpath "${@}")}") # Open Universal Actions /usr/bin/osascript -l JavaScript -e 'function run(argv) { Application("com.runningwithcrayons.Alfred").action(argv) }' "${absolute_paths[@]}" } A couple of notes: The function is Zsh-specific. It is possible to do the same in Bash, but the focus above is on macOS’ default.It requires macOS Ventura or above. Again, it is possible to make it work on older versions, but it would be more verbose. Most of the code is checking if paths exist. That’s not strictly necessary and you can make it significantly shorter by only including the local -r and /usr/bin/osascript lines.
  3. I can’t say (because I can’t know) if a workflow which isn’t built yet will be a fit for the Gallery. It is doable to evaluate a workflow that exists but much harder to comment on an idea, even if it’s from someone who no doubt has the skills to execute. A good rule of thumb is to not build workflows with the explicit goal of being featured in the Gallery. The process is “pull” (creators are contacted for submissions of specific existing workflows) rather than “push” (creators submitting anything unprompted). Even some of my own workflows won’t ever be added and will continue to only exist in the forum and GitHub. That is OK. The goal of the Gallery is not to contain every possible workflow but have some degree of curation. Regarding the name (and default keyword), it is possible the 1Password folks could have a problem with it. I’m not a lawyer (nor have I played one on TV), but it’s my understanding that in certain jurisdictions you have to defend your trademarks to not lose them. Regardless, since it does not in fact interact with any 1Password product, as it stands it would no doubt generate confusion and support requests. For reference, the 1Password workflow in the Gallery was created with the full knowledge of the 1Password team, including permission to use the name and icon. Hope that clarifies it. It’s a couple of busy weeks so it may take me a bit longer to reply, but I’m aiming to check your other post soon too. There are already curious parties in this thread, so I’ll be sure to keep an eye out.
  4. It should also work if you simply launch the app as normal from Alfred, by opening it and typing its name. Using word should work for your example, unless Microsoft is doing something funky (it worked fine on every app I tried just now). Or use @Stephen_C’s suggestion but with an od Keyword Input instead of a Hotkey. As a fun aside, on macOS you can also press fn and a to select and navigate the Dock with the arrow keys. Not as convenient or fast as doing it from Alfred, but neat trick nonetheless. There are a new other fn + single letter shortcuts available (e.g. fn + n for the Notification Centre) if you feel like experimenting.
  5. Because you have the Automation Task that is copying the path from the Finder. As per above, you have to remove that because you’re going for a different result.
  6. Quick note: If you want the full path, you don’t even need the Automation Task, you can connect the Universal Action directly to the Copy to Clipboard. Considering your last post, you might want a File Filter instead of a Universal Action. I highly recommend you go through the interactive guide, as linked above. It’ll teach you the basics and help you to figure out how to figure out these details.
  7. @Domscillator It’s hard to debug the issue if you’re using an internal workflow which cannot be shared. Please provide at least the debugger output, as it should provide a clue.
  8. As stated, there may be a better way to achieve what you want (we’d need more details to say for sure), but if you’re looking to access some option in the menubar, you may be looking for the Click Menubar Item in From App Automation Task.
  9. A more efficient way of handling this would be to, instead of relying on file search to open the command file, making a workflow (connect a Keyword Input to an Open File Action, or even better a Run Script Action) and adding the icon to the workflow or Keyword. Consider that if Alfred were to read the custom icon for every file of every file type, that could have a noticeable impact on performance (even unrelated searches) since there’d be an extra operation that would need to happen before displaying each result.
  10. Would you mind giving a specific example of how you’re looking to use this? Just to be sure I understand what you’re asking. I think you may be looking for the Paste Path Into Dialog workflow. It relies on some GUI automation, but there’s not really a great alternative to that as there’s no app-agnostic way to just replace that dialog, it’s a macOS thing.
  11. Welcome @Patrick Graf, Seems like you’re looking for the Script Filter Input. You’ll be able to take whatever is input in Alfred, then do your calculations and return some JSON which will show up in Alfred.
  12. Should also be worth considering joining both workflows together for the next version, so people only have to install one. Or (I just thought of this while writing the previous sentence) even having a Script Filter that both shows the battery and allows for connecting and disconnecting (you shouldn’t be able to know battery levels anyway when AirPods are disconnected, I’d guess). If you have an alternative icon, that would be helpful to further differentiate from the other AirPods workflow too. It surprised me a bit when I downloaded the Connector yesterday, as the icon in the notification was different from the one in the workflow.
  13. This is vey much untested (I have neither Pro Tools nor a keyboard with numpad), but what I was suggesting was something like: const systemEvents = Application("System Events") const keycodeNumpadMap = { "0": 82, "1": 83, "2": 84, "3": 85, "4": 86, "5": 87, "6": 88, "7": 89, "8": 91, "9": 92, ".": 65 } function run(argv) { argv[0].split("").forEach(character => { systemEvents.keyCode(keycodeNumpadMap[character]) }) systemEvents.keyCode(76) } This is using /usr/bin/osascript (JavaScript).
  14. That’s more of a question for the workflow’s author. There’s also Amazon Suggest in the meantime (which may or may not be of help to @giovanni too to figure out the issue).
  15. @porcupine945 When asking about an existing Workflow, it’s best to use its own forum thread. While it may seem that starting a new thread could give your problem visibility, it fragments the discussion and makes it less likely the author and users of the workflow (the people who can help) will see it. I’ve moved your post to the correct thread.
  16. The number of locations is not relevant, only that the syncing service evicts files. Please make sure your preferences are always available offline: Open System Settings and click on your name at the top. Then select iCloud and disable Optimise Mac Storage.
  17. Added! Quick note: I see that you’ve compiled and signed/notarised the blueutil binary. For security and transparency (most users arriving at the Gallery won’t have built a rapport with developers), we add a small note to the page when a third-party binary is included in a workflow. You can see it under the install/download buttons (see another example). If you’d prefer to instead remove the binary and use the Homebrew formula as a dependency (example), we can do that too. There’s no wrong or right answer, though, it’s whatever you prefer. I definitely get the choice to include the binary so user’s don’t have to worry about the extra download. By the way, you should be able to make a universal binary (instead of shipping two of them and having the conditional) with: /usr/bin/lipo -create /path/to/arm_version /path/to/intel_version -output /path/to/universal_version
  18. Not exactly, as the workflow already used Python 3, only the path changed so everyone’s on the same version. That break sometimes happens after a macOS update.
  19. You’re conflating the language dropdown (not hardcoded) with the PATH variable (which is hardcoded but can be overridden; see method 2). They are different things. In addition, ~/zshenv isn’t a standard file to be read by Zsh, ~/.zshenv is (note the leading dot). But that will only be read when the language is set to /bin/zsh, not when it’s /bin/zsh --no-rcs or any other non-Zsh language. launchctl doesn’t figure into it.
  20. Click on the first item, then hold ⌥ and click on the second one, then the third. I also recommend you see the Getting Started Guide for an interactive tutorial on making a workflow.
  21. Looks like you might not have executable permissions set in the script, as per the message. How are you running it from outside Alfred? If you’re running it like python /path/here instead of /path/here, it would corroborate the issue. Could you share your workflow? transfer.sh is good temporary storage.
  22. What you probably want is the Split Arg Utility. Send your argument as one string (separated by e.g. commas or newlines, whatever makes sense in your case) and then split it into multiples.
  23. It won’t. You can run your first command without issue. In your Run Script, if you have it set up to run Sequentially (top right), a subsequent run of that same trigger (and only that) won’t run until the first one finishes. if you change it to Concurrently, you can run it as many times as you want at the same time.
  24. I’m not at my Mac right now, but the way that should work is to take the user input (a string of digits), split it (get an array of characters), then run a loop where for every item in the array you check if it’s equal to a number and if so send that key code. Let me know if you can work with that. If not, I’ll take a look later.
×
×
  • Create New...