Skip to content

Cannot listen to MenuItem's Title changes in the app's MenuBar #38

Description

@tomaskupka

Hey, thanks so much for this library. It works great for observing changes on windows etc.

However I cannot make it work to observe a MenuItem's Title changes in the app's MenuBar.
I can construct UIElement object that locates that MenuItem. It's the correct pointer, because I can perform an action successfully.

menuItem.performAction(kAXPressAction)

Is there some trick to achieve that or the app may be even broadcasting those events?

Snippet of my code:
var menuItem = UIElement(getMenuItem()) //my function that returns the MenuItem as AXUIElement
//try menuItem.performAction(kAXPressAction) //just a test if the pointer is working

try observer.addNotification(.titleChanged, forElement: menuItem)

No events are triggered using this code. I tried also Accessibility Inspector and the MenuItem has exact ID, and just changes it's Title (a toggle).

Thanks for any clue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions