How to get global screen coordinates of currently selected text via Accessibility APIs.

前端 未结 3 2056
有刺的猬
有刺的猬 2020-12-01 07:11

I need help to find out, how Dictionary app showing following popup dialog for selected text on pressing CMD+CTRL+D on any application. I want to implement the same kind of

3条回答
  •  被撕碎了的回忆
    2020-12-01 07:41

    What you're looking for is a Service. With services, your app doesn't even have to be running or capture global hotkeys.

    For example, the functionality of the dictionary app you described is actually a service, observable in the Services menu.

    Dictionary Service Menu

    Apple's Service Implementation Guide is probably the best info on services out there.

提交回复
热议问题