Jump to content

andy4222

Member
  • Posts

    274
  • Joined

  • Last visited

  • Days Won

    3

Reputation Activity

  1. Thanks
    andy4222 got a reaction from sinled in File filter results in grid view   
    Posted a similar question here: 
     
  2. Thanks
    andy4222 got a reaction from sinled in Simple ideas: opening a frequently used folder   
    This makes sense.
     
    Let me ask differently. Any way to emulate how the Alfred file search feature but results show up in a  Grid View?
  3. Like
    andy4222 reacted to Stephen_C in Simple ideas: anatomy of a moving workflow   
    Background
    I’ve posted this workflow before but I’m going to dissect it to show you some of the features available in a really simple but useful workflow. Of course, there’s an Alfred Universal Action to move a file or files but there’s also a way to create a quick shortcut to that Universal Action. That’s what this workflow does but it’s worth looking under the skin to investigate some of the details.
     
    The skeletal workflow

     
    The explanation
    We use a Hotkey Trigger rather than a Keyword Input because we want something that's quick to use. Double click on a Hotkey Trigger and take a moment to look at the options (see next screenshot but one). We choose “Pass through to workflow” as opposed to “Show Alfred”. The Argument is “Selection in macOS” because we’re wanting to move a file or files selected in macOS. If you click on the “Related Apps” tab you can add Finder in order to ensure the hotkey works only when Finder has focus:    
    Tip: Use that to ensure your Alfred hotkeys work only in the apps where you want them to work—or to use the same hotkey in different apps triggering different features in each app.
     
    Return to the Hotkey Settings tab and click where indicated:

     
    Then you’ll see the following:

     
    We check “Pass through modifier keys (Fastest)” because we want the fastest possible reaction from Alfred when we have a file or files selected and we then press the hotkey.
     
          2. The Action in Alfred dialog has a little trick up its sleeve (double click on the Action to open the dialog box):

     
    We limit the “Treatment:” to “File” and (the trick) change “Jump to:” from a blank to “Move to…”. That way we have instant access to Alfred’s “Move to…” Universal Action. (The other things to which you can jump, bypassing the list of Universal Actions, are Recent Documents…, Open With…, Open URL in…, Email to…, and Copy to… .)
     
    In conclusion
    When using a workflow like this all you need to do to move a file (or files) in Finder is to select it (or them), press the hotkey and start typing, in Alfred’s window, the name of the folder to which you wish to move the file or files. When the relevant folder name is displayed simply press ⏎ to move the file or files to it. But even in a simple workflow there’s a lot going on behind the scenes.

    Stephen
  4. Like
    andy4222 reacted to Stephen_C in Simple ideas: opening a frequently used folder   
    Background
    Many times a day I open my ~/Downloads folder in various sizes and shapes of window. However, I have a preferred size and shape for that Finder window and, with a very simple Alfred workflow, it's easy not only to cater for that but also to add some useful options.
     
    The skeletal workflow

     
    The explanation
    1, 2 & 3 are all you need for the basic workflow. The remainder are the icing on the…workflow.
     
    I use a Keyword Input because I find it difficult to recall all the hotkeys used in my various apps. Of course, you could use a Hotkey Trigger if you wish. This is a simple Open File Action containing the path to the folder you wish to open. We use an Automation Task to set the bounds of the Finder window exactly was we want them. This is where we are Using Alternative Actions so that ⌥⏎ will take us along the new path in the workflow. Note, in the same Action, we also tell Alfred not to close Alfred's window in order to prevent flickering. (To access the Alternative Actions simply double click the round marker along the connecting line after an input object.) An Automation Task passes the contents of the folder (choosing, in my case, to sort by most recently added) to… Alfred's Grid View—where we can see the contents of the folder displayed in a grid (set to "Keep the results in order defined”). In that view we can search for any item, use ⌘O ("O” for "open”) to open any selected item in its default app or just press ⏎ to move on to action the item in Alfred. Again we keep open Alfred's window (as in 4 above). The Action in Alfred action provides access to Alfred's Universal Actions appropriate to the selected item (allowing you, for example, to delete or move the item, open it in Finder, etc.).  
    In conclusion
    Sorry for the long-winded explanation of a very simple workflow. Once you have it up and running you may, like me, use it many times a day and everything very soon becomes second nature.
     
    Incidentally, there's a splendid workflow from Vitor on the Alfred Gallery called Thumbnail Navigation which allows you to navigate the file system with previews…so you may never need anything similar to what I've described here. But you don't learn as much using other's workflows as you do when writing your own, do you? 😉
     
    Stephen
  5. Like
    andy4222 reacted to vitor in Don't overlook the little, simple things!   
    Here’s a related neat trick. One problem is that sometimes a menu item changes its name depending on something else in the app. For example: in Messages you can see Edit → Tapback Last Message… by default, but if you select a message it changes to Edit → Tapback Message… You can use that difference to your advantage in the workflow to e.g. only make something happen when the right option is available, but sometimes you want activate the menu item regardless of this detail. In this case what you can do is add both as separate Automation Tasks. Because an Automation Task error stops the flow of execution, this means only the active option will get through. You can see this exact example in action in the Tapback Message workflow.
  6. Like
    andy4222 reacted to Stephen_C in Don't overlook the little, simple things!   
    I'm sure I'm preaching to the converted but there are some really easy, useful things you can do with Automation Tasks in a workflow. I'll give you an example.
     
    I have frequently to battle with a reasonably deeply nested menu in Day One in which I can turn off, or on again, smart quotation marks. (Tip: don't have a workflow called Save 'ur… something!). Finally, this morning, realisation slowly dawned. Keyword: dss, linked to:

     
    Now why didn't I think of that before?
     
    If you suffer from deeply nested, often used, menu items…well, there's a possible solution!
     
    Stephen
  7. Thanks
    andy4222 reacted to vitor in Screenshots — Search and act on screenshots   
    As stated, the most likely cause is that the API is down for the moment.
     
    Changes made to the shortcut are not supported, only the unmodified workflow. If you want to make a report on the upload action of the shortcut not working for you, you can use the Feedback Assistant app on your Mac to contact Apple, I have no control over their implementation.
  8. Haha
    andy4222 got a reaction from foxytrot in Sync Typinator Snippets to Apple Snippets (iOS/macOS)   
    Hey Alfred community,
     
    Although I do use Alfred Snippets all the time, I've also started using Typinator for regex based and input based text replacement.
     
    I wanted to share a quick solution for converting your Typinator text snippets to Apple Text Snippets that can be used on iOS (since Typinator isn’t on iOS).
     
    I’ve created an Alfred Workflow and a Python script (if you don’t use Alfred) that automates this conversion process. The script takes a CSV file as input (snippets can be exported in CSV from Typinator). It generates an plist file (Apple Text Snippets format). All you gotta do is:
     
    1. Open text snippet via settings. Select all and drag them to a directory. This will be your backup of the existing iOS snippets
    2. Delete the iOS snippets from the settings.
    3. Drag the newly generated plist file here.
    DONE
     
    Feel free to give the script a try and let me know if you have any questions or suggestions
     
    - Alfred Workflow: Trigger Universal action and type “Convert” and it should show up. Generated the output.plist in the same directory. https://www.dropbox.com/s/58w4vv342sgoog4/Typinator To Apple Snippets.alfredworkflow.zip?dl=0
     
    - Python file: Simplify your life (this takes in the full path of the input CSV file as an argument) `python3 converter.py` https://www.dropbox.com/s/5j2e4jdp5gfo5s4/converter.zip?dl=0
  9. Like
    andy4222 reacted to Stephen_C in Open macOS settings panes   
    Version 2.0 is on the Alfred Gallery now.
     
    Stephen
  10. Like
    andy4222 reacted to Stephen_C in Open macOS settings panes   
    Just a quick note that I've updated my Open macOS settings panes workflow to add access to some anchors in the Accessibility, Privacy & Security and Sharing panes. The workflow is on the Alfred Gallery and will doubtless be updated there to version 2.0 in due course.
     
    Stephen
  11. Like
    andy4222 reacted to vitor in Keyword Arg mandatory but can be ignored with modifier key   
    Add a uid: "search_splunk", line above the title one. The value of uid can be anything, it just needs to be static.
     
     
    You can’t do that because you’ll no longer be able to set the custom argument.
     
     
    Script Filter JSON Format.
  12. Like
    andy4222 reacted to Stephen_C in Alfred command history (up arrow)   
    Alfred Preferences → Advanced then check under History.
     
    Stephen
  13. Like
    andy4222 reacted to vitor in Keyword Arg mandatory but can be ignored with modifier key   
    For such specific custom behaviour, you’ll need a Script Filter instead. Set the language to /usr/bin/osascript (JavaScript) and use this code:


    function run(argv) {   return JSON.stringify({ items: [{     title: "YOUR TITLE HERE",     subtitle: "YOUR SUBTITLE HERE",     valid: argv.length > 0,     arg: argv[0],     mods: {       cmd: { valid: true },       alt: { valid: true },       ctrl: { valid: true },       shift: { valid: true }     }   }]}) }

    Replace YOUR SUBTITLE HERE and YOUR SUBTITLE HERE with whatever you want.
  14. Like
    andy4222 reacted to vitor in Backup Preferences — Create and restore Alfred Preferences backups   
    Usage

    Generate a backup of your local Alfred Preferences via the start backup keyword. A macOS launchd agent will be loaded to do it daily at the time set in the Workflow’s Configuration (using the 24-hour clock format). The number of versions to keep is likewise configurable.



    Restore a previous version with the restore backup keyword. It takes a few seconds to complete and restarts Alfred.



    ⤓ Install on the Alfred Gallery | Source
  15. Like
    andy4222 reacted to zeitlings in Heads-up Display   
    @andy4222 The recommended way is to use SPM (Swift Package Manager). However, I quickly tested a minimal-effort approach that works. You can compile the script as is without changing anything about the code. 
     
    Navigate to HUD.swift with your terminal (or open the Workflow in Alfred, double-click any of the two objects, then click the little folder icon in the bottom left corner to open the location, select HUD.swift and send it to Alfred’s Universal Action (opt+cmd+#). From the options, choose “Open Terminal Here”.
     
    In the terminal that opens paste and run this to create the executable at the same location.
    swiftc -O HUD.swift  
    In the workflow, open the "Run Script" object and replace 
    ./HUD.swift "$1" 250  
    with
    ./HUD "$1" 250  
    Voilà.
  16. Like
    andy4222 reacted to zeitlings in Heads-up Display   
    Or better yet, just replace the contents of the "Run Script" object with this:
     
    [[ -f ./HUD ]] || eval $(swiftc -O ./HUD.swift) ./HUD "$1" 250  
    If the executable does not exist yet, it will be created and then called.
  17. Like
    andy4222 reacted to Stephen_C in Alfred Gallery — Search Workflows on the Alfred Gallery   
    See Script Environment Variables.
     
    Stephen
  18. Like
    andy4222 reacted to zeitlings in Set Default Browser   
    @andy4222 That is probably the Apple Script taking some time to wake up. MacOS will always ask you if you are sure you want to change the browser. The script focuses that modal window and "clicks" the button to accept the change. If you're switching to an another window before that has happened, the script will fail. So yeah, there might be a delay (also for the swift script to execute if it is called the first time after a while; after that it seems to be cached somewhere and executes faster.)
  19. Like
    andy4222 reacted to Stephen_C in Conversions   
    Both can be downloaded so (as we say in bad English) "you pays your money and takes your choice” (although, of course, you pay nothing for either of them 😀).
     
    It's rather easy to see that:
    as stated, my workflow has no dependencies—the other uses PHP so if you use that workflow you'll be guided to install PHP if not already installed; the alternative workflow offers many more conversions and a visual abundance of decimal places (compared to the paltry two decimal places of my workflow). I could continue…but why not do your own research? 🤷‍♂️
     
    Stephen
  20. Like
    andy4222 reacted to Acidham in Chromium Bookmarks and History Search   
    I am on M1 Pro as well, but search works superfast. Improving performance implies I need to be able to reproduce first or being able to narrow down to one of the browsers. 
     
    I suggest starting, narrowing the problem down to one Browser. Delete history files and start from scratch and see when performance gets worse, etc. 
     
    Once reproducible, I am happy to look into the issue. 
  21. Like
    andy4222 reacted to Vero in Ignore in Alfred — Exclude files and folders from Alfred’s search results   
    @andy4222 Type "reload" to refresh the app cache. This should take care of it
  22. Like
    andy4222 reacted to zeitlings in Define Word - A Better Dictionary   
    Hey @andy4222, glad to hear you find it useful. The workflow is unlikely to end up in the gallery because it relies on functions that are only available through Objective-C. This means that there can not be a pure Swift version and that the program, on order to work, needs to be compiled into an executable binary, which I'm currently not having notarized by Apple. This in turn is a prerequisite for executables to be included in the gallery (which is a good thing all in all ).
  23. Like
    andy4222 got a reaction from kpw in Trying to decide to buy Lifetime or current version   
    Just buy the lifetime version, it's totally worth it. No brainer basically. I bought it like 5 years ago and the team has released so amazing features consistently. It's the best investment I have made. Saves me so much times in doing menial (and sometimes complicated) things. Plus, Alfred is not subscription based despite releasing new features.
  24. Like
    andy4222 reacted to zeitlings in How to show user input form?   
    Hey @andy4222, there is no way to do this with Alfred as far as I know. However, you can build it yourself from scratch.
    I just finished an experiment that raises a graphical prompt that passes the values you enter to Alfred. This works by wrapping the GUI, i.e. SwiftUI components, in an  NSWindow instance.
     
    To make it work for your needs, you will need to customize the SwiftUI view and its components.
    I think the results are quite promising though. 😄
     
    You can download the experiment here



     
  25. Like
    andy4222 reacted to Stephen_C in RSS Feed for Alfred Gallery   
    It's planned: see here.
     
    Stephen
×
×
  • Create New...