2

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?

Community
  • 1
  • 1
olivier
  • 1,007
  • 8
  • 14

1 Answers1

1

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.

Milos
  • 2,728
  • 22
  • 24
  • Thanks, I had overlooked services. Unfortunately, they don't allow any selection manipulation and I can't find a way to programmatically trigger one with the user's selection (as part of a larger suite of actions or even just to configure a keyboard shortcut in my app instead of the system preferences one). – olivier Mar 30 '16 at 07:38