Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OSX Accessibility - How to bring window allll the way to the front?

I'm using osx accessibility API to try and bring a window to the front. The documentation says that kAXRaiseAction "Simulates bringing a window forward by clicking in its title bar"

AXUIElementPerformAction(myWindowRef, kAXRaiseAction);

Except it doesn't... It only brings the window forward passed all the windows of the same application, which is not what happens when you click the title bar of an app.

When I actually click a Finder window(one of many), it comes allll the way to the front, passed the windows of all the other processes, without bringing any other finder windows forward with it.

How can I simulate that behaviour?

https://developer.apple.com/library/mac/documentation/UserExperience/Reference/Accessibility_RoleAttribute_Ref/Actions.html

like image 567
CuriousGeorge Avatar asked Oct 02 '22 16:10

CuriousGeorge


1 Answers

You could select the window as you are already doing, and then activate the application using -[NSRunningApplication activateWithOptions:].

like image 55
JWWalker Avatar answered Oct 11 '22 17:10

JWWalker