Allow Creation of Context-Aware Text Handling Services in OS X

Originator:robmathers
Number:rdar://12368755 Date Originated:25-Sep-2012 02:02 PM
Status:Open Resolved:
Product:Mac OS X Product Version:
Classification:Enhancement Reproducible:Not Applicable
 
Summary:
Currently OS X offers the ability to create a service to manipulate selected text, or separately to insert new text. However it is impossible to create a single service that can handle both cases.

This would be very useful for some situations—such as a service that creates markup that could insert a fully formatted HTML tag with the selected text enclosed, or insert a tag with no text in the case of no selection.

Steps to Reproduce:
1. Create a service as detailed in the Services Implementation Guide with NSStringPboardType specified in the NSReturnTypes.
2. Add a NSSendTypes key specifying an NSStringPboardType.
3. Open a text document and note that the service is not available when no text selection is made.
4. Remove the NSSendTypes key.
5. Open a text document and note that the service is available when no text selection is made, but it overwrites any selected text if activated when a selection is active.

Expected Results:
The service should be available both when text is selected and when no selection is made. The behaviour could be optionally enabled through an Info.plist key, as with most other Services settings.

Actual Results:
A single service can only be made available when text is selected OR when there is no selection. If a selection is active when a service that does not register for pasteboard input is activated, it will be overwritten.

Regression:

Notes:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!