Is there a way to be notified when my app icon is moused over in the Dock?

Thank you in advance!

Answered by Claude31 in 719263022

I found this very old SO post advising to use Accessibility API

https://stackoverflow.com/questions/8411587/detecting-mouse-over-dock-any-dock-icon-click

As a complement, how to locate your icon in the dock which show how to use accessibility API.

https://stackoverflow.com/questions/6684278/getting-the-position-of-my-applications-dock-icon-using-cocoas-accessibility-a

Or search for the UIElementInspector 44 sample code, as proposed here by Quinn:

https://forums.swift.org/t/swift-macos-listen-to-open-close-events-of-any-application/29021

Hope that may help.

Accepted Answer

I found this very old SO post advising to use Accessibility API

https://stackoverflow.com/questions/8411587/detecting-mouse-over-dock-any-dock-icon-click

As a complement, how to locate your icon in the dock which show how to use accessibility API.

https://stackoverflow.com/questions/6684278/getting-the-position-of-my-applications-dock-icon-using-cocoas-accessibility-a

Or search for the UIElementInspector 44 sample code, as proposed here by Quinn:

https://forums.swift.org/t/swift-macos-listen-to-open-close-events-of-any-application/29021

Hope that may help.

Is there a way to be notified when my app icon is moused over in the Dock?
 
 
Q