I'm writing a Mac utility app in which I would like to manipulate text and selection in third-party apps. I found two methods for doing so:
However, they both have major drawbacks and I'm wondering if there are any other methods I could explore?
I'm writing a Mac utility app in which I would like to manipulate text and selection in third-party apps. I found two methods for doing so:
However, they both have major drawbacks and I'm wondering if there are any other methods I could explore?
This is precisely what services are for – see Services Implementation Guide. In a nutshell, you make an app and register it as a service provider. You advertise your service using Info.plist
where you specify NSStringPboardType
as both the sender and return type. The user will then be able to right-click on a text selection in any app and choose your service from the popup menu.