How to get selected text everywhere with xcode

I am new to xcode development. I canโ€™t find a simple free and easy to use translator on Mac OS, so I decided to write it myself.

The most important function for this project is that it can receive text wherever it is on Mac OS, which means that I can select the text in the Preview when reading PDF files, either in the context menu or in the shortcut mode -cut - the perfect way start my translator.

My main question is: how to get selected text in xcode when waking up my translator? If you can tell me how to register a global context menu or short cut, I would also be very grateful.

Thanks:)

+4
source share
1 answer

Why just write an application that registers as a Mac OS X Service (in the application menu)? Then it will interact with any Cocoa without any extra work. See http://developer.apple.com/library/mac/#documentation/cocoa/conceptual/SysServices/introduction.html for details.

+2
source

Source: https://habr.com/ru/post/1369188/


All Articles