AtYourService Henry Krempel This example demonstrates how applications can export ĒServicesē to other applications (they will appear in other applications' Services menu). AtYourService's services may be enabled or disabled via the Services inspector in the Preferences Application. Services are facilities that are available to other applications. The Application requesting Services does nothing but indicate which types of data it is willing to send and receive. A service provider (like this application) accepts data on one of the system pasteboards and processes it. This data may or may not be returned to the requestor. AtYourService provides a number of simple text services that will appear on other applications "Services" menu. "Edit" is a good application to try this out with. Services Provided by this application are: Dictionary Sort returns data in alphabetic order Numeric Sort returns data in numeric order Reverse Sort returns data in reverse sorted order. Unique Sort sorts the data and only returns lines that are unique. Capitalize simple phrase capitalizer Timestamp returns the time and date Setting Sort Fields: You can specify which columns AtYourService will use when sorting your data by using the Set Sort Fields... menu item. This will present you with a panel where you can specify which field (or column) will start and end your sort data. Fields are numbered starting at one (not zero). Normally a blank space would be used to separate fields, but on this panel you can also specify an alternate separator character. Installation Notes: The new services will appear in an application's Services menu only if the following conditions are met: 1) AtYourServices.app (not the debug version) is installed in ~/Apps, or one of the well known system Apps directories, 2) the services cache is updated, 3) the Services menu is redisplayed on the screen after the services cache is updated, 4) the service is not disabled in Preferences. The easiest way to meet these conditions is to Build AtYourService in ProjectBuilder with the Args: set to install. This puts it in the right place, ensures that it's not the debug version, and updates the cache. Toggling the Services menu in the requesting application will rebuild the menu from the new service cache. Objects in AtYourService: MyDelegate the main delegate for AtYourService. This object is the Application's and Services delegate, and contains all of the Services methods. DefaultHandler Handles interactions with the Defaults system. Verifier a text delegate that tests the validity of data entered on a text field. The tag is used to store the valid length, and the EntryType in the TextField is used to store the datatype (see the DefaultHandler object, where this is set up). Other Files: Makefile.postamble contains a rule that rebuilds the services cache when the application is installed using make install in a Terminal window, or when using ProjectBuilder's Build with the install argument. services specifies the services that are provided. This file is automatically inserted into the application wrapper during normal application installation. See the following for more detailed information about Services: /NextLibrary/Documentation/NextDev/Concepts/Services.rtf /NextLibrary/Documentation/NextDev/ReleaseNotes/Appkit.rtf NeXTanswer #874 Not valid for 1.0 Not valid for 2.0 Valid for 3.0