Jump to content

Tekl

Member
  • Posts

    34
  • Joined

  • Last visited

Posts posted by Tekl

  1. How can this be done? My use case is this: I select Text with hyperlinks in Mail, press a shortcut and then the clipboard contains the markdown representation.

     

    As Alfred’s hotkeys strip the formatting from selected text, I can't pass it to the Shortcut. I see no difference to my first approach with a Hotkey and a Script.

  2. Sorry, I probably shortened my question too much. My question is. does Alfred itself check regularly if updates are available? I do know, how to install available updates. But I don't know if I have to click on "Alfred Gallery » Check for Workflow Updates" regularly.

     

    image.png.51557a17d58df05b230d6f54c7282978.png

  3. When I launch the Dependency Manager, it always asks me to install Homebrew manually. I already did this. In the first step, I wanted Alfred to install Homebrew for me, but it failed. Now it always shows `Homebrew install failed: please install manually from https://brew.sh/`.

     

    My workflows using Homebrew and Tools are running fine, but it would be great to get the Dependency Manager working again.

     

    I uninstalled Homebrew this morning for some tests. Before this, Alfred worked well. I'm running macOS 14 first Dev beta on Apple Silicon. Maybe that's causing the problem.

     

    How does Alfred try to detect if Homebrew is installed?

  4. 54 minutes ago, vitor said:

     

    Unless you compile it to a binary.

     

    Having the Command Line Tools isn’t an issue, though.

    Ah, good idea. But then changing scripts is more complicated and compiling Is not enough. I have to codesign and notarize it. And I don't know how to compile universal binaries. Sorry, I'm no developer, I don't want it complicated. 😁 It seems that a corresponding makefile will be bigger than the simple swift script. 

  5. Well, this swift script seems to work (it sends Cmd+Up to Roon), but it only works when the Command Line Tools are installed.

     

    #!/usr/bin/env swift
    import Cocoa
    
    func sendShortcutToProcess(bundleIdentifier: String, keyCode: CGKeyCode, modifierFlags: CGEventFlags) {
        if let targetProcess = NSRunningApplication.runningApplications(withBundleIdentifier: bundleIdentifier).first {
            let pid = targetProcess.processIdentifier
            guard let eventSource = CGEventSource(stateID: .hidSystemState) else {
                print("Failed to create event source")
                return
            }
            
            let keyDownEvent = CGEvent(keyboardEventSource: eventSource, virtualKey: keyCode, keyDown: true)!
            keyDownEvent.flags = modifierFlags
            keyDownEvent.postToPid(pid)
            
            let keyUpEvent = CGEvent(keyboardEventSource: eventSource, virtualKey: keyCode, keyDown: false)!
            keyUpEvent.flags = modifierFlags
            keyUpEvent.postToPid(pid)
        }
    }
    
    // Usage: Call the function with the desired bundle identifier, key code, and modifier flags
    sendShortcutToProcess(bundleIdentifier: "com.roon.Roon", keyCode: 126, modifierFlags: .maskCommand)

     

  6. I would like to split a text at every tab character and then paste every splitted item into the frontmost app with a following Key Combo. I can do it with a long list of clipboard actions to paste {var:split1}, {var:split2} and so on. It's okay with limited number of items. But I want it to be more flexible, so it works with every amount of tab chars in the text. For this, I need to connect the last "Arg and Vars" again with the first condition which checks, if there is text left for processing. Alfred seems not to allow this loop. Have I missed a loop feature or does Alfred actively block loop creation?

×
×
  • Create New...