0

When I use iBooks on Mac, and highlight a word with a mouse, English Thesaurus is shown: enter image description here

I'd like my program to do similar thing - to appear like this Thesaurus in iBooks.
How can it be reached? The simplest idea is recognizing that some text is selected, but maybe iBooks has some API (nothing useful at https://developer.apple.com/ibooks/).
Or maybe Mac OS has event "single word selected", and I can subscribe for it.

What kind of app is best suited for that: Cocoa App or some extension/plugin?

I'm not interested in "long way" (context menu): enter image description here

Any advices will be highly appreciated, because I don't know anything about that.:)

olha
  • 2,132
  • 1
  • 18
  • 39
  • 1
    What is the question, how to detect the selection of text or how to show the thesaurus? How do you display the text? What did you try? Is [Supporting Contextual Lookup](https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/DictionaryServicesProgGuide/access/access.html#//apple_ref/doc/uid/TP40006152-CH5-SW2) of Dictionary Services what you're looking for? – Willeke Jun 30 '17 at 08:17

1 Answers1

1

What I think you are looking for is NSView's showDefinitionForAttributedString:atPoint: method or one of its siblings. HTH

CRD
  • 52,522
  • 5
  • 70
  • 86