Jump to content

vitor

Staff
  • Posts

    8,495
  • Joined

  • Last visited

  • Days Won

    708

Everything posted by vitor

  1. Welcome @Romain, Here’s a Workflow for it, with the same keyword as yours. Tested only with Brave, but their AppleScript dictionary is the same. Simply asking macOS to open the URL (open -a) wasn’t working, neither was changing it on the page with JavaScript (location.href). Seems like it might be a deliberate decision on their part, as with Safari it works (well, it tries to open the page but Safari doesn‘t use view-source:). The solution was to tell it to open a new tab with the URL via JXA.
  2. Dispatch Key Combo. You can also use an Automation Tasks to get the current tab URL.
  3. I found the tell application "Alfred 4.app" in the action.scpt file, which is called by the Run Script.
  4. @pubay To get the selected files, Alfred simulates a ⌘C (it’s the one method that works reliably across macOS), which is why you’re seeing the Edit menu light up (the option to copy). What Hotkey do you have set up?
  5. @Acidham Instead of tell application "Alfred 4.app", use tell application id "com.runningwithcrayons.Alfred" because that is constant across versions. It’s what the External Trigger example shows.
  6. Welcome @MarkyBoy, If the folder is always at the same place, use a Hotkey Trigger or Keyword Input to start the Workflow and use the Pick Path Automation Task to set up the path. Connect it to an Argument and Variables Utility to save it as a variable (e.g. scan_folder = {query}). If the folder isn’t in a fixed location, use a File Action Trigger or File Filter Input. List Filter Input → Conditional Utility (to branch over the actions you want to perform). Keep the connection going to a Keyword Input. At its output, have another Argument and Variables Utility to save your input to another variable (e.g. new_name = {query}). At this point, more information is needed. In step 2 you mention multiple files, but on step 4 you only mention one. If you rename all the files the same thing, you’ll overwrite them and end up with just one. Can you clarify this step? Depending on the desired outcome, some things may change above (probably in step 2), but the majority will continue to apply.
  7. Universal Action Trigger or Hotkey Trigger with Argument set to Selection in macOS. Replace Utility set to “Replace regex (.{16})(.*) with $1-$2”. Copy to Clipboard Output (check Automatically paste to frontmost app).
  8. Go into 1Password and tell it to “Open and Fill” the website you want. Copy the URL from the browser.
  9. You need to first find a website which search functionality. Then do a search and look at the resulting URL. E.g. if you search on YouTube for alfredapp, the resulting URL is https://www.youtube.com/results?search_query=alfredapp.
  10. That’s a limitation imposed by 1Password. Alfred is only asking macOS to open the website, it doesn’t control how the 1Password extension will behave after that. To auto-fill the details from a URL in 1Password 8, you now need to know the item’s ID and add it as a parameter to the URL. The official 1Password Workflow does that. But 1Password has to be unlocked. To have the extension behave differently in the browser, you’ll have to make the request to the 1Password team.
  11. Again, this is dependent on the website, the search is implemented by them. Alfred is just telling macOS to open the URL, which passes it on to the browser. Whatever happens next is in the hands of the website. Custom searches don’t search a webpage, they open it. They are a quick way to access a website’s own search functionality, which has to be a URL that exists. The one you’re trying is invalid, it does not exist on the website and it does not appear to have search functionality.
  12. Can you clarify the question? What specifically are you having trouble with? What steps are you taking, what is happening, and what did you expect to happen? If your question concerns the 1Password Workflow, please make your question in its thread and provide the information requested in the second post.
  13. Maybe this helps: a Workflow can run a command you yourself would run in a Terminal. When you’re developing, a separation of concerns helps. Language version managers and virtual environments are tools in the box you can use. They also make it simple to throw everything away and start over, so don’t worry too much about it yet. That’s for uniqueness. You can change the names of those directories at will (I do) and Alfred will pick it up. Yes, but it ends up being more cumbersome for the developer too, especially now with Apple removing languages. Other than packaging the dependencies with the Workflow, another thing authors may do is ask you to install them yourself (again, see second thread you linked). Or asking someone else, yes. But those kinds of things are generally put front and centre in the Workflow’s instructions. Precisely so stuff doesn’t break and so both you and the developer have a frame of reference when debugging. The terminal is an app which allows you to interface with a shell. They are separate things. Unless the Workflow specifically interacts with the Terminal, it shouldn’t be a problem.
  14. That is the issue. Do git -C $(brew --repo homebrew/core) checkout master and try installing PHP again.
  15. Welcome @DCools, That output is valid JSON you can process in a number of ways. Because it’ll be consistent, you can use a Replace Utility set to replace regex .*"width":(\d+),.* with $1, which will give you the width. But we can do better. Automations Tasks 2022.7 was just released with a dropdown so you can return individual details like the width.
  16. It’s not possible for a Workflow to install libraries in a way that would mess up your system, because macOS’ System Integrity Protection (which you likely have not disabled) would prevent that. But even before that was implemented, doing stuff system-wide would require sudo (in other words, being asked for your password). A Workflow can only install a library somewhere you as a user have access. And for it to be disruptive (unlikely) it would have to be a location which you specifically use/load, at which point you’d know and be able to trivially uninstall it anyway. In a literal decade of frequenting this forum, I don’t recall that ever being an issue. Plus, recent macOS changes would only make that harder. Including the library with the Workflow is the way to go and the most convenient to users (and to developers, for debugging purposes). Right click Alfred.alfredpreferences and choose “Show package contents”. From there, go into workflows. Or right click a Workflow in the preferences and “Open in Finder”. A .alfredworkflow is a renamed zip which on install unpacks to that directory. That’s how it should be done. In the second one you linked, @giovanni and I go into detail. Yes, they are installed in the Workflow’s directory. So if you delete the Workflow, so goes the library.
  17. Web Searches open a specific URL in the browser. If you have a search with a parameter (like search?q=), however that is interpreted is up to the website itself. Once Alfred sends the URL to the browser, it’s out of its hands.
  18. @OmarKN The page could indeed be more explicit about how to install the tool. You need to install Homebrew and brew install tag. But if you’re on Apple Silicon, the install location will be different from what the Workflow expects. As an alternative, I just updated LabelColor to support tags. No prior setup is required.
  19. Removing connections doesn’t disable the Workflow, it only disables what actioning the object will go. To disable a Workflow, right click it in the Workflow’s list and until the first option.
  20. @YuTang Open the debugger and perform the failing action. That should give information to help understand what is happening.
  21. Welcome @YuTang, From your description you need neither variables nor programming, just a few objects. Connect a File Filter (configured as you want to detect your files) to a Conditional. In the latter, set it to if {query} matches regex Library/Application Support/obsidian. Change the path to something else if you have Obsidian stored anywhere outside the default location. Finally, connect each to an Open File Action. In the top one set Obsidian as the app to open the passed-in files, in the other leave the default.
  22. Great, that is clear. Thank you. Use an Automation Task. URL Processing → Get URL Hostname.
  23. Welcome @SonicBlueJedi, You have custom code in Alfred Preferences → Features → Terminal. It may be outdated and not working. If you’re using iTerm2, check Custom Alfred iTerm Scripts. If you no longer care for it to be custom, set it to the default Terminal.
  24. I don’t understand the question. The regex goes in the first field, not the second. That’s for what it will be replaced with. This looks like an XY Problem. Please explain what is the goal of the Workflow (not just one step) so we can best help you.
×
×
  • Create New...