I’m developing a macOS app using SwiftUI and need to interact with windows of other applications. Specifically, I need to:
-
Get the current windows.
-
Get the name of the application owning each window.
-
Get the size and position of each window.
-
Change the size and frame of windows while they are open.
I’ve found some information related to using the Accessibility API and AppleScript, but I’m not sure how to integrate this with SwiftUI or if there’s a better approach.
Could anyone provide guidance or examples on how to:
-
Integrate this with SwiftUI properly.
-
Modify the size and frame of windows programmatically.
Any help would be greatly appreciated!