Jump to content

Floating.Point

Member
  • Posts

    153
  • Joined

  • Last visited

  • Days Won

    10

Floating.Point last won the day on July 20

Floating.Point had the most liked content!

Recent Profile Visitors

1,156 profile views

Floating.Point's Achievements

Member

Member (4/5)

51

Reputation

  1. Another option is to use Hammerspoon (which can of course be called from Alfred if desired) https://www.hammerspoon.org/docs/hs.spaces.html
  2. I’ve always wanted a way to: 1) Determine the front most app. 2) Check it’s file type associations. 3) Display a list of those files on my system sorted by date modified. I haven’t gone very deep down the rabbithole, but feel this may be helpful: https://developer.apple.com/documentation/coreservices/launch_services
  3. @sepulchra Sounds cool, please share when you work it out. I'm curious if you hope to programatically ascertain the associated filetypes from the frontmost app. That would be nice!
  4. @sepulchra I Use Recent Files by JY, I've also toyed around with using a second workflow to make it context sensitive to the foreground app, which actually works pretty nicely. This is outlined here
  5. Thanks for the workaround @Andrew. I’m glad I could help, even in a tiny way to make Alfred better- I love Alfred so much ❤️
  6. As part of my larger system for using Alfred, I employ Karabiner Elements to invoke Alfred via a single press of the Caps Lock key. It's just a nice, big, easy-to-hit, one-shot key to launch Alfred, and you can still activate Caps Lock's normal functionality via Shift + Caps Lock If you want this for yourself, its easy: Install and open Karabiner Elements Go to ‘Complex Modifications’ Click ‘Add your own rule’ Copy and paste the contents of this JSON into the field Open Alfred Preferences Go to General Set Alfred Hotkey to ⌃⌥⇧⌘+Space. (If you’ve already set up Karabiner Elements, simply press your Caps Lock key here)
  7. Ah thank you @FireFingers21 for both confirming my issue is actually real, and for providing a beautiful solution! I just tested now and it works flawlessly for ZSH. I also did a quick search for an equivalent in Python (which I'll need) and this appears to be possible via Python's exec() (I'll test this later). @Andrew Would you mind taking a look at the above, in case it might be a bug?
  8. I am having an issue and would love it if someone could take a look. There's actually a really interesting quirk happening that almost makes me think this could be a bug. In summary: Using the contents of a Split Arg is not working as expected when fed into a script via JSON Config object. I uploaded a copy of the workflow here: https://github.com/NeighNeighNeigh/Alfred_HotkeySystem/blob/main/Troubleshooting splits into scripts 01.alfredworkflow and I've put a little screencast together to demonstrate the issue:
  9. App Specific Workflow Examples I have put together 2 example workflows. Both of these are using the List Filter Input to build a menu of options. Example App Control - Basic In the Basic Example, every item in the List Filter is duplicated into a Conditional Utility - then these branch into other Alfred features. So selecting the menu item will execute along the relevant branch. If you want a new menu item, you add it to the List Filter, and the Conditional, followed by whatever you want Alfred to actually do. Do note though, I don't use this method, as I find maintaining it too cumbersome. Example App Control - Advanced In the Advanced Example, we still use a List Filter to choose items. But instead of maintaining a Conditional for every single list item, we make use of Alfred's Split Arg Utility. In the Arg field of each List Filter item, the first line is used to indicate which branch to follow in the Conditional. The second line (three dashes '---') is used by the Split Args Utility so that everything below will be passed through to the subsequent objects. This makes maintaining the menu far easier, as most of the work can be done in the List Filter alone. You might have 20 entries in the List Filter, but only 4 branches in the Conditional. Once set up, whenever you want to add a new menu item you just add it to the List Filter, give it a nice name and an icon, and fill ut the Arg field as required. Download files I've uploaded the examples to a githib repo you can find here: https://github.com/NeighNeighNeigh/Alfred_HotkeySystem/releases/tag/V1.0.0 I am happy to explain further, just shoot with any questions.
  10. Okay I put together a write-up of my system. I'm nowhere near a 'writer' by trade, so apologies if it's a bit hard to parse.
  11. I reserved this post to include more information and examples of my personal App Specific Workflows in Alfred.
  12. TLDR From Claude 3.5 Alfred Setup: System and App-Specific Hotkeys Overview Two main hotkeys: ‘System’ and ‘App Specific’ System hotkey: Invokes Alfred (when pressed alone) or acts as Hyper Key (when held) App Specific hotkey: Launches workflow for current app Key Setup (using Karabiner Elements) Caps Lock: When held: Hyper Key (Command+Control+Option+Shift) When pressed alone: Hyper Key + Spacebar Command: When held: Remains Command When pressed alone: F19 Steps: Install Karabiner Elements Go to ‘Complex Modifications’ and click ‘Add rule’ Add the following custom complex modifications as separate rules. For each: Click ‘Add rule’ Copy and paste the Gist content into the field Click ‘Save’ Rules to add: Hyper Key Implementation for Alfred Command to F19 when pressed alone Alfred Configuration Set main Alfred hotkey to Hyper Key + Space (⌃⌥⇧⌘+Space) Workflow Setup System workflows: Use Hyper Key + [letter] for system-wide functions App-specific workflows: Create a workflow for each app Set Hotkey Trigger to F19 Add app to ‘Related apps’ in Hotkey Trigger Object Implement desired app-specific actions using Alfred’s various tools and features Benefits Easier to remember commands across different apps Customizable to user’s needs Utilizes rarely used keys (Caps Lock, Command alone)
  13. TLDR In the next post is a TLDR generated by LLM Claude 3.5 and tweaked a little manually Introduction I use a combination of Alfred and Karabiner Elements to control my system and applications with 2 main hotkeys. I have a ‘System’ hotkey that performs system-wide tasks, and a ‘App Specific’ hotkey that will perform tasks unique to the currently focussed application. System-wide Tasks The System Hotkey The System hotkey has two main functions: Open Alfred Instantly: Press the System hotkey alone to open Alfred. Hyper Key for Shortcuts: Hold the System hotkey to use it as a Hyper Key, letting you combine it with other keys for various system-wide tasks. Some examples: Hyper + H: Opens Alfred to your home folder. Hyper + C: Accesses Alfred's Clipboard Manager. Hyper + S: Shows your snippets. Hyper + V: Manages your audio settings. Hyper + P: Returns you to your last used path in Alfred. Hyper + R: Opens your recent files workflow. By limiting these to commands useful across all applications, you maintain a clean, efficient system. Customized App-specific Commands The App Specific Hotkey Remembering all the hotkeys and commands for different applications can be difficult. My solution is to create app-specific Alfred workflows. When I need a specific function in an app repeatedly, I add it to a tailored Alfred workflow. With the App Specific hotkey, you can launch a workflow that presents a list of commands tailored to the current application. This can include: Issuing hotkeys Launching scripts Choosing menu items Running complex macros built with Alfred's nodes This allows you to personalize workflows to fit how you use each application. Choosing the right keys System hotkey I use Karabiner Elements to create a 'Hyper Key' (Command+Control+Option+Shift simultaneously). Using the Caps Lock key for this is ideal because it's easy to press and not often used otherwise. Regular Caps Lock functionality is still accessible by pressing Shift + Caps Lock. App Specific hotkey This one is nifty. As a modifier key, Command only ever functions when combined with another key (Command+N for ‘new’ etc). So we can use Karabiner Elements again, this time to remap the Command key to ‘something else’ when it is pressed alone. That ‘something else’ becomes the hotkey to launch our App Specific Alfred Workflows (I use F19 for this) System setup Karabiner Elements config Set up the following rules in Karabiner Elements Caps-Lock, when held, becomes Hyper-Key Caps-Lock, when pressed alone, becomes Hyper-Key + Spacebar Command, when held, remains Command Command, when pressed alone, becomes F19 Follow these steps to configure Karabiner Elements: Install and open Karabiner Elements Go to ‘Complex Modifications’ Click ‘Add your own rule’ Copy and paste one of the below Gists into the field and click save Repeat for the second rule. Github Gist’s for each rule Karabiner Elements - Hyper Key Implementation for Alfred Karabiner Elements - Command to F19 when pressed alone Alfred Config Set the main Alfred hotkey Open Alfred Preferences Go to General Set Alfred Hotkey to ⌃⌥⇧⌘+Space. If you’ve already set up Karabiner, you can just press your Hyper-Key here. Alfred Workflows integration System Hotkey Example Perhaps you have an Emoji Picker workflow. If you’re like me, Emoji selection is an often used system-wide function. So within Alfred’s preferences, open your Workflow and edit the existing (or create one if required) Hotkey Trigger Object. Open the object, enter the Hotkey field and press Hyper-Key + E. System hotkeys don’t have to be Alfred specific of course, anything on your system that has system-wide hotkeys can be set to use the Hyper-Key. App Specific Workflows Here we make use of Alfred's Hotkey Object's Related Apps feature. From Alfred’s documentation: So we: 1) Create a new workflow for each app we want to control. 2) Set the Hotkey Trigger to our App Specific hotkey, 3) Add the app to the ‘Related apps’ filed within the Hotkey Trigger Object. 4) Use Alfreds tools to create a list of actions specific to that app. And that's it. In the end you have two hotkeys. One you invoke to adjust systems settings, the other when you need to do something in-app. The hotkeys are easy to reach, and one-hit. It's great! Since implementing it has really become a joy to use. the clear distinction between system and app related interactions works really well for me. Cheers!
  14. The simple idea here’s is maintaining 2 hot keys. One for system stuff, one for app specific stuff. Maybe I could do a write up of what my personal ‘App control’ workflows do, but the main point here was that they all share a single hoktkey and it feels nice and simple as a system in operation.
×
×
  • Create New...