Jump to content

vitor

Staff
  • Posts

    8,678
  • Joined

  • Last visited

  • Days Won

    724

Reputation Activity

  1. Like
    vitor got a reaction from luckman212 in Calling External Triggers with alfred://runtrigger URI scheme - Inbound Configuration vs "legacy" way   
    There’s no documented list of them all. If memory serves, alfred://runtrigger/ is the only one.

    The others (I could be misremembering but I think you got them all) are more for Alfred’s internal use than general consumption. In theory their format could change or they could have unpredictable behaviour when called unorthodoxly so you should avoid relying on them. In practice Andrew is really good at this programming stuff and cares so much that things are robust from the get go that we end up latching on to those. It’s kindda like reading the Clipboard History’s SQLite: you shouldn’t really do it but I’ve been at it for a decade and even explain how. In my defence, there is a bolded caveat!

    So, yeah. We don’t mind that you use those approaches and may even tweak them to be more useful to you but they’re not advertised as features to allow for some flexibility. The people who use those well and smartly (like you two) tend to be the ones who find them.

    That said, we all like good documentation so the door is not closed on someday deciding to write those up.
  2. Like
    vitor reacted to Stephen_C in Your most used workflows   
    It would be helpful if you would provide some examples of the "many [outdated] scripts” because I'm sure the maintainer of the Gallery would wish to know.
     
    Perhaps that's a matter of opinion. What sort of things are you looking for that you're unable to find on the Gallery?
     
    (Just in passing, you did click on the link I provided and checked the Alfred Gallery, did you? It doesn't sound as if you're describing the same thing!)
     
    Stephen
  3. Like
    vitor got a reaction from cands in Note Taker — Keep small bits of text   
    Updated to 2024.3.
    Show asterisk help in File Filter. Do not close window on nview.

  4. Like
    vitor got a reaction from paulw in Gallery and non-homebrew dependencies   
    That wouldn’t work, because the environment is different.
     
    See Understanding the Scripting Environment.
  5. Like
    vitor reacted to spongeblink in Clipboard History Archive   
    Agreed.
     
    Haha, looking forward to your release! 
  6. Haha
    vitor got a reaction from spongeblink in Clipboard History Archive   
    OK, I was very confused this morning. I’ve made a workflow for this exact purpose with this exact name (unreleased yet but it’s in the hands of a few people who asked for it) so I was a bit puzzled when reading the post name. Same idea, but I see we went about it in different ways for the backup. Diversity is good. I wasn’t aware of the older script, though.
  7. Like
    vitor got a reaction from sepulchra in Go To Here   
    If the list needs to be updated dynamically, that’s more the job of a Script Filter. Do keep in mind that if you add a Filter (List, Script, or File) in this workflow with your preferred locations, it’s no long generically shareable to other people (which is OK). You could e.g. have another workflow with your specific Filter, and then have it call this workflow via an External Trigger. Best of both worlds: It works for you without extra steps and is shareable to other people.
     
    Haven’t inspected the current version yet, will do that later.
     
    Have a nice weekend.
  8. Like
    vitor got a reaction from sepulchra in Go To Here   
    Marking as transient makes the entry not appear in Clipboard History, but it is still in the clipboard at that moment. Meaning that if you ⌘V, that’s still what you’ll get.
     
    There may be a simpler way to accomplish this, but I’ll take a look when the next version of the workflow is released.
     
    As for File/Universal Action VS File Filter, my recommendation is having both. They don’t really trample on each other and different people have different mental models. I, for example, always use File/Universal Actions because I tend to find the file first (could be in Finder but equally as likely it’s in Alfred via the Thumbnail Navigation’s Fast Entries feature or a simple search). But I often add File Filters if they make sense (and I don’t forget) for other people.
     
     
    Unsure. I’ll look at it when the new version is live and report back if I come up with something.
  9. Like
    vitor got a reaction from paulw in Go To Here   
    If the list needs to be updated dynamically, that’s more the job of a Script Filter. Do keep in mind that if you add a Filter (List, Script, or File) in this workflow with your preferred locations, it’s no long generically shareable to other people (which is OK). You could e.g. have another workflow with your specific Filter, and then have it call this workflow via an External Trigger. Best of both worlds: It works for you without extra steps and is shareable to other people.
     
    Haven’t inspected the current version yet, will do that later.
     
    Have a nice weekend.
  10. Like
    vitor got a reaction from Paliz in Multiple keywords for a single script filter   
    Starting from Alfred 5.1 (currently in pre-release), multiple keywords are supported.
  11. Like
    vitor got a reaction from spongeblink in Accessing clipboard history inside a Workflow   
    On a Workflow with multiple manual steps, you may find it useful to access recent clipboard history in order to pass along previously copied data to the next stage.

    But if you switch context to the Clipboard History Viewer, you lose your place in the Workflow. To avoid that, you can load your history into a Script Filter and place it between the relevant steps of your Workflow. This post provides working code to do just that.

    Things to note:
    This works by directly accessing Alfred’s clipboard history SQLite database, so it can be considered a hacky solution. Use at your own risk. That said, it only reads data. By default it shows the 40 most recent items from the clipboard history. Look for LIMIT 40 in the script to change that value. Only text entries are considered. Everything else is ignored. The code does not limit you to the clipboard contents. If you type something, that will be used instead. Paste the code in a Script Filter without a Keyword, Argument Optional, and Language set to /usr/bin/zsh --no-rcs.
     
    if [[ -n "${1}" ]] then /usr/bin/osascript -l JavaScript -e 'function run(argv) { return JSON.stringify({ items: [{ title: argv[0], arg: argv[0] }] }) }' "${1}" exit 0 fi /usr/bin/sqlite3 \ "${HOME}/Library/Application Support/Alfred/Databases/clipboard.alfdb" \ "SELECT JSON_OBJECT('items', JSON_GROUP_ARRAY(JSON_OBJECT( 'title', item, 'arg', item))) AS JSON_RESULT FROM ( SELECT item FROM clipboard WHERE dataType IS 0 ORDER BY ts DESC LIMIT 40)"  
  12. Like
    vitor got a reaction from spongeblink in Always use Alfred’s bundle identifier when invoking via AppleScript or JavaScript for Automation / JXA   
    When interacting with an app via AppleScript or JavaScript for Automation (JXA), it is common to do so via its name:
     
    tell application "Safari" to activate -- AppleScript
    Application("Safari").activate() // JXA
     
    But often the bundle identifier is a better choice:
     
    tell application id "com.apple.Safari" to activate -- AppleScript
    Application("com.apple.Safari").activate() // JXA
     
    In Alfred’s case, the latter is always preferred. It’s what the External Trigger uses in the example. Instead of Alfred 5, which changes with new versions, com.runningwithcrayons.Alfred is unchanging so it always points to the latest one installed.
  13. Like
    vitor reacted to sepulchra in Go To Here   
    just for fun @paulw, I thought I would try and recreate this without the applescript but with alfred's built in objects.
     

     
    And just another thought -- if you wanted to recreate some of the functionality of default folder x, you could also created a list filter with favorite folder paths as well.
  14. Like
    vitor got a reaction from spongeblink in Using {const:} to keep workflow details up to date in objects.   
    You may already know that you can use {var:} to create user-configurable keywords, which makes workflows more convenient for users. But did you know you can use {const:} to make workflows more convenient for yourself?

    Alfred sets a number of alfred_ environment variables with useful information. alfred_workflow_cache and alfred_workflow_data are particularly relevant in scripts but you can access the information in objects too via the {const:} pattern.

    It’s common that in workflows which use a main Keyword / Script Filter as the entry point, I’ll have its title and subtitle match the name and description of the workflow. While workflow names seldom change, sometimes descriptions need a little tweak. If you’re copying the information back and forth, you may forget to update relevant workflow objects to match the new wording. Unless, that is, you use {const:alfred_workflow_name} and {const:alfred_workflow_description}, ensuring the information is kept in sync.

  15. Like
    vitor got a reaction from paulw in Alfred Gallery — Search Workflows on the Alfred Gallery   
    Usage

    Search workflows in the Alfred Gallery via the gallery keyword.


    ↩: Open Gallery page in default browser. ⌃: Show tags. ⌘↩: Install workflow. ⌥↩: Narrow search to creator’s name. ⌘Y (or tap ⇧): Quick Look workflow’s Gallery page.
    ⤓ Install on the Alfred Gallery | Source
  16. Thanks
    vitor got a reaction from Klizzy in Create new iCloud hide my mail address trough Alfred   
    Welcome @Klizzy,
     
    Nice first submission!
     
    My first suggestion would be to replace the config. It’s currently a Text Field but it should be a Popup Selection because you only want users to select from a few pre-defined sources. Also, adding a user-configurable keyword.

    The second suggestion, and this one is trickier, is handling latency. I also have something like this locally (though I only need the panel, not the auto-creation) but the way I do it is language-agnostic because I’m clicking on elements by index instead of by name. The tradeoff is that if Apple changes the position of anything in a later macOS version, it will need a fix. Neither solution is better, just a choice. But I digress, the point is that all those GUI interactions take a while to execute. And Hide My Mail is slow. I tried your workflow a couple of times and it didn’t quite reach the end as the delays weren’t enough. In general, relying on fixed wait times for some GUI thing to finish is error-prone. My suggestion is to identify the click target, loop a short delay until it is available, and only then try to click it.
  17. Like
    vitor reacted to sepulchra in Alfred Gallery — Search Workflows on the Alfred Gallery   
    I had a funny feeling.... and thanks as always for the additional info. 
  18. Like
    vitor got a reaction from sepulchra in Alfred Gallery — Search Workflows on the Alfred Gallery   
    Oops, forgot a step! I was updating two others at the same time and then didn’t make everything available. Fixed now, thank you for mentioning. 

    For reference, when I make the comment in a forum post it should already be available by the time you see it. Though when you see it on the workflow itself will depend on your local cache. Or, more specifically, if it’s at the top. You should still be able to search for it and ⌘↩ would still get the latest version.

    Also, this wouldn’t be forgotten indefinitely, it would eventually be live with other updates. But still thank you for letting me know, there might have been other people confused.
  19. Like
    vitor reacted to 2pilvic in Screenshots — Search and act on screenshots   
    I love your workflow, which now works perfectly in my Dropbox folder. It’s a pleasure to have nearby, just a click away, people as prepared and willing as you to spend their time helping others. Thank you very much Vitor
  20. Like
    vitor got a reaction from spongeblink in Shortcuts — Run installed macOS shortcuts   
    Anecdotally, that happens to me constantly. Building a shortcut on macOS to use on iOS is a real pain (but so is making the shortcut directly on a phone). Some shortcuts sync, others don’t, deleted shortcuts remain on one device… It always requires manual fiddling, which is extremely hard as there’s no way to force a sync.
     
     
    Great, glad you’re sorted! Have a nice weekend.
  21. Like
    vitor got a reaction from Alan He in Automation Tasks Change Log   
    2024.7

    Stripping Trailing Lines: Output same result regardless of ending newline.
  22. Like
    vitor got a reaction from Alan He in Automation Tasks Change Log   
    Automation Tasks are always evolving. It is recommended that you automatically keep them up to date but you might also want to know about new changes from time to time.

    The primary source to learn about updates is the GitHub releases section on the repository. You can visit the page regularly or subscribe to the feed in an RSS reader. This thread will provide a secondary source to those who prefer to check the forum.

    Note that not every minute change is listed in the changelog. For example: when adding a new group of tasks (which can be handful or a ton of them), the addition of the group is listed but not each task.

    You can view a list of all available Automation Tasks by adding one to a Workflow and perusing the list, or consulting the documentation.
  23. Like
    vitor got a reaction from poirpom in Currency Converter — Convert between different currencies   
    Usage

    Convert currencies via the cur keyword. Type a number to see all available currencies with their full name and code.



    Type a currency code or name to filter.



    Pressing ↩ on a partial match triggers the autocomplete. See all conversion targets when matching a unit exactly.



    Type further to filter for target units. Connector words (“to”, “as”, “in”) are optional to help with readability.


    ↩ Copy result to clipboard. ⌘↩ Paste result to frontmost app.
    Configure the Hotkey or use the Universal Action as shortcuts to convert results from Alfred’s Calculator, Clipboard History, or selected text.



    Rates provided by Exchange Rate API.

    ⤓ Install on the Alfred Gallery | Source
  24. Like
    vitor got a reaction from andy4222 in Automation Task - Menubar item in Front App not triggering "Tags..."   
    They’re the only ones who can answer that, I encourage you to ask!
     
    Hazel runs all the time in the background, so for example they could periodically (or in response to file system events) check tags applied to files and update the database. Or they could be using some feature from macOS which shows that information for free without feeding it back to apps (that interface looks quite similar to a Finder search). Or they could be using a private API. Or they’re using a solution I and the other users who looked at it haven’t found or thought about.
     
    Lots of possibilities, all of them speculation, several of them wouldn’t work in this context, none of them can be confirmed except by the source.
  25. Like
    vitor reacted to luckman212 in Ignore in Alfred — Exclude files and folders from Alfred’s search results   
    I always learn something from every one of your posts @vitor ! I've been using the comments forever because I thought the tags didn't work reliably, or couldn't be viewed from the Finder get info box or something. But that's obviously old & outdated info.
     
×
×
  • Create New...