Seeking Feedback on My Mac Utility App for Active Windows and Alt Tab Functionality

Kindly help… I have ben having this issue for sometime.

Alston said:
I like it. It’s fast and smooth. But I miss a close button for the individual windows

I didn’t even think of that. I will see if that’s possible

Corey said:

Alston said:
I like it. It’s fast and smooth. But I miss a close button for the individual windows

I didn’t even think of that. I will see if that’s possible

If you find an API to close other applications then please let me know. My app could really use this, but I gave up on finding a way. By the way, I love the app and would love to test it. Will it be open source

@Sal
It won’t be open source, sadly. But I do have an open source app called openartemis if you want to check that out. I figured out how to close windows. You will need to use the accessibility API, of course. Get the reference to the specific window as an AXUIElement and get the close button attribute:

static func getCloseButton(for windowRef: AXUIElement) -> AXUIElement? {
        var closeButton: AnyObject?
        let result = AXUIElementCopyAttributeValue(windowRef, kAXCloseButtonAttribute as CFString, &closeButton)
        if result == .success {
            let closeButtonUIElement = closeButton as! AXUIElement
            return closeButtonUIElement
        }
        return nil
    }

Then, use it like so:

           if let closeButton = getCloseButton(for: windowRef) {
            let closeResult = AXUIElementPerformAction(closeButton, kAXPressAction as CFString) }

Hope this helps

Sal said:
@Corey
Many thanks

No problem. You may also be able to do something like this if you don’t need such specific window control. But, I haven’t tested this and I’d imagine there is some permission or attribute your app will need to be able to do this.

https://developer.apple.com/documentation/foundation/process/1409620-terminate

import Cocoa

func closeApplication(named appName: String) {
    let runningApps = NSWorkspace.shared.runningApplications
    for app in runningApps {
        if app.localizedName == appName {
            app.terminate()
            return
        }
    }
    print("Application \(appName) not found")
}

// Example usage
closeApplication(named: "Safari")

Alston said:
I like it. It’s fast and smooth. But I miss a close button for the individual windows

Good news, I have implemented this and it will be available in the initial release

Alston said:
@Corey
Good news. Can’t wait to see it in action

You can test it out now! See my other comment: https://www.example.com

@Alston
Hey, thanks! I will look into the minimized functionality

Linden said:
Following

It’s probably releasing in about a month or so. Keep an eye out for ‘DockDoor’ announcement. I will post in this forum

Corey said:

Linden said:
Following

It’s probably releasing in about a month or so. Keep an eye out for ‘DockDoor’ announcement. I will post in this forum

Remind Me! 1 Month