TweetFollow Us on Twitter

Mac OS X Services

Volume Number: 20 (2004)
Issue Number: 12
Column Tag: Programming

Mac OS X Services

Revisiting an Old Favorite

by Clint Bagwell

Remember the Services menu? It was one of the then-new features advertised with the coming of the first version of OS X. Three generations later Services are still a core component of the contemporary Mac OS and also one of its best kept-secrets. Developers and power users know about Services' system-wide, interactive functionality, but home users can also make the most of their many practical uses.

About Services

Services were one of the many NEXT innovations that were incorporated into the first version of OS X. Services can be found under any native OS X program's Application menu. The Services menu extends an application's functionality by providing some of its own capabilities to other programs. When an application signs up for Services, it takes advantage of another application's abilities as well. This feature is made possible by transferring data through a shared pasteboard (which exists independently of the normal Copy/Paste pasteboard). Apple includes some services as part of its operating system, and makes it easy for developers to use the technology in their own applications. When using more than one application, Services can improve workflow efficiency to save time.

Let's look at a practical example using just the Services that are already built in to OS X. You get a confirmation email from an order you placed online. With the email open in Mail, you select the confirmation number and choose Make New Sticky Note from the Service menu. Stickies automatically opens and creates a new note containing the confirmation number to view later. The email includes a number to track the package on a website, but leaves the URL incomplete so it is not an active link. No problem. You select "USPS.com" in the message and choose Open URL under the Services menu. Safari opens and is intelligent enough to locate http://www.usps.com/ for you. Daily tasks like these become less cumbersome with the Services menu's seamless integration of often used applications. Apple also includes many other helpful services that make use of the Finder, Mail, TextEdit, and Safari. The Grab application's Services are popular, as they provide an easy way to take screen shots from another application. Another Service that is often mentioned is Start Speaking Text. The simple command enables the power of OS X's speech center to aid in editing text. This tool is invaluable for catching mistakes that your eye may have missed. These are just a few of the helpful Services tied in to OS X's bundled applications.

Unfortunately, whenever I introduce someone to Services, they get really excited about it for five minutes and never use them again. Sound familiar? Let's face it, the Services menu has its pros and it definitely has its unfortunate cons. The biggest complaint I hear are that Services are not always available. It is up to the application developer to support it or not (Microsoft, I am looking in your direction...) To be fair, you may be surprised to hear that AppleWorks doesn't use them either. On top of this, many users get confused because you usually must have something selected in order for the Services to become active. The Services menu makes system-wide shortcuts available (Search With Google is Command+Shift+L), a plus in my book. On the other hand, Apple leaves it up to the developer to define the keyboard command, a definite problem. A user can easily wind up with two services trying to use the same shortcut. I will go over some ways to work around this issue later in the article.

Ready-Made Toolbox

We have looked at the services already included in OS X; a user can even further enhance productivity with add-ons. Devon Technology's "Service Pack" is my favorite set of downloadable 3rd party services. In WordService, Devon has created a variety of useful tools for manipulating, inserting, or analyzing text. Developers take note of items like Mac- to Windows-Encoding or Unix Line Endings. The average user may find that Initial Caps Of Sentences, Insert Long Date and Time or Statistics will add more power to the TextEdit program, and make him less dependent on Microsoft Word (http://www.devon- technologies.com/products/freeware/freeware.php).

If you routinely handle sensitive data, consider Security Service from Ambriel Software. The standard version adds the ability to encrypt or shred a file that is selected in the Finder. The pro version beefs up encryption options and enables others such as "Free Space Shredding" (http://ambrielsoftware.com/products/ security_services/).

If all of these tools aren't enough for you, push the Services menu over the top with the more than 120 that come with Text Wielder from Tinnef Software. In addition to text formatting tools similar to those of WordService, it includes research options such as Search Apple Help, Phone Number - Reverse Lookup at AnyWho.com, and package tracking from several providers. A word of advice: saturating the Services menu can drastically increase login times, as OS X searches for all that are available. Luckily, Text Wielder comes with the ability to activate or deactivate its abundance of menu options. Power users may take interest in the scalability of this program: Text Wielder gives them the ability to create additional Service menu items by harnessing the power of AppleScript and SFRL (Simple Find and Replace Language) (http://www.commongrnd.com/~blenkush/ textwielder.html).

Roll Your Own: Customizing And Creating Services

So what makes up a Service menu item? Add-on Services like WordService are installed by dragging .service files to /Library/Services or ~/Library/Services, but Services that are part of another app are typically part of its information property list. It is the Info.plist file within the Package's Contents directory that declares how an application's services appear in the Services menu and what type of data it can handle. When you open this file in a text editor (reminder: always backup your application before editing) you will look for the property called NSServices, and with it the components that make up a Service menu item. Remember that pesky issue of two applications using the same keyboard shortcut? Take a look at the example below:

<key>NSKeyEquivalent</key>      
   <dict>                        
      <key>default</key>          
      <string>B</string>          
   </dict>

Changing the B between the string tags to another character will change that menu item's shortcut to whatever you choose. (Keep in mind that OS X will automatically add Command+Shift to your character in the menu).

For the coding-challenged, PearSSC from Pearworks will do all of this with a graphical interface. Drag the application to the PearSSC window and type a letter; not only is it easy, it's free (http://www.pearworks.com/pages/software.html ).

Ready to take Services to the Extreme?

If you like using the command line, you will love SilverService by Rob Hague. This application consists of a panel that holds a list of your own Shell commands (complete with title, input, and output). SilverService then lists your commands by title under its own Service menu (http://www.rho.org.uk/software/silverservice/).

Similarly, ACP Web Services harnesses the power of search queries for its convenient and customizable Service menu. This application is based on the premise that most search engines use a query string with the desired word or phrase tacked onto the end of it (example: http://www.google.com/search?q=apple). So when you select a word in TextEdit and activate one of the ACP Services, it pastes your selection onto the end of its string to form a complete URL. To customize, write your own query or simply copy it from a search made on your favorite website, and add it to the APC list (in the above example you would copy the URL minus the word apple). What's more, ACP Web Services includes a "grab bag" of pre-built services ranging from Traceroute to a variety of international language Google searches. The pro version also adds a full service manager and shortcut editor for the entire Services menu (http://rixstep.com/4/0/aws/).

Developer Note:

Why should developers pay attention to the Services menu? Consider this example: MarketCircle utilized Services to creatively boost functionality to DayLite, a popular CRM application for Mac OS X. It features the ability to send e-mails to customers natively from the application, while recording the text in its database. Users naturally requested the ability to record incoming emails into the database as well, to capture their customers' responses. Rather than turn DayLite into a full-fledged e-mail client, MarketCircle simply added Services that work cleanly with Mail and other Services-aware applications. The user selects text and chooses the appropriate Service to create a note, task, or appointment in DayLite. When asked about their use of Services, MarketCircle's president Alykhan Jetha had this to say: "We decided to use the Services menu because of the its power. We realized the value of the Services architecture during our NeXT days."

If you're a developer, it's in your best interest to take another look at Services. Offer interactivity with other applications to make your application more beneficial without creating an entire plug-in or rewriting your app altogether. Think of the Services Menu as a great location for us to access your program's capability system-wide without crowding our menubars with extra icons. And by the way, it's not just for Cocoa anymore!

For More Information on Developing Services:


Clint Bagwell is a freelance Macintosh Consultant and visual artist working in New York City. For more information go to http://appleconsulting.net/bagwell

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Bartender 4.1.7 - Organize your menu-bar...
Bartender lets you organize your menu-bar apps by hiding them, rearranging them, or moving them to Bartender's Bar. You can display the full menu bar, set options to have menu-bar items show in the... Read more
VirtualBox 6.1.28 - x86 virtualization s...
VirtualBox is a family of powerful x86 virtualization products for enterprise as well as home use. Not only is VirtualBox an extremely feature rich, high performance product for enterprise customers... Read more
Pro Video Formats 2.2.2 - Updates for pr...
Pro Video Formats includes support for the following professional video codecs: Apple Intermediate Codec Apple ProRes AVC-Intra 50 / 100 / 200 / 4:4:4 / LT AVC-LongG XAVC XF-AVC DVCPRO HD HDV XDCAM... Read more
MySQL 8.0.27 - Industry-leading open-sou...
MySQL, the industry-leading open-source SQL database, is an accessible, easy-to-use relational database management system (RDBMS). As an alternative to Oracle and SQL server, MySQL offers features... Read more
Typinator 8.10 - Speedy and reliable tex...
Typinator turbo-charges your typing productivity. Type a little. Typinator does the rest. We've all faced projects that require repetitive typing tasks. With Typinator, you can store commonly used... Read more
Motion 5.6 - Create and customize Final...
Motion is designed for video editors, Motion 5 lets you customize Final Cut Pro titles, transitions, and effects. Or create your own dazzling animations in 2D or 3D space, with real-time feedback as... Read more
Suitcase Fusion 21.4.4 - Font management...
Suitcase Fusion is the creative professional's font manager. Every professional font manager should deliver the basics: spectacular previews, powerful search tools, and efficient font organization.... Read more
EtreCheck Pro 6.5.3 - For troubleshootin...
EtreCheck is an app that displays the important details of your system configuration and allow you to copy that information to the Clipboard. It is meant to be used with Apple Support Communities to... Read more
iMovie 10.3 - Edit personal videos and s...
With a streamlined design and intuitive editing features, iMovie lets you create Hollywood-style trailers and beautiful movies like never before. Browse your video library, share favorite moments,... Read more
Compressor 4.6 - Adds power and flexibil...
Compressor adds power and flexibility to Final Cut Pro X export. Customize output settings, work faster with distributed encoding, and tap into a comprehensive set of delivery features. Features:... Read more

Latest Forum Discussions

See All

Divinity - Original Sin 2 - Gameplay Jou...
When I last touched Divinity - Original Sin 2, I thought I was done with my seafaring shenanigans aboard the Lady Vengeance. I was away from Fort Joy on course for Driftwood, but my journey got interrupted. This entry deals head on with this... | Read more »
SwitchArcade Round-Up: ‘Spectacular Spar...
Hello gentle readers, and welcome to the SwitchArcade Round-Up for October 20th, 2021. In today’s article, we’ve got several new games to check out. A few of them seem like they could be a good time, which is always a pleasant bonus. There’s a... | Read more »
‘Horizon Chase’ Senna Forever Expansion...
Following the reveal of the Horizon Chase Senna Forever expansion, the game was updated today on all platforms. If you’ve not kept up with the excellent racer, Horizon Chase Senna Forever is a new expansion that pays homage to the legendary driver... | Read more »
Square Enix Opens Square Enix London Mob...
Square Enix just announced its newest studio today in the form of Square Enix London Mobile. Square Enix London Mobile is a new studio in London aimed to publish and deliver high quality free to play mobile games worldwide. The studio is currently... | Read more »
Beginner’s guide to becoming a fearsome...
The Lord of the Rings: Rise to War is NetEase’s brand new strategy game based on JRR Tolkien’s epic fantasy trilogy. Choose your favourite characters as Commanders, assemble your army, and march to fight until you claim the One Ring for your own.... | Read more »
‘The Lord of the Rings: Rise to War’ Tip...
If you’re looking for some of the best ways to progress quickly in The Lord of the Rings: Rise to War, then you’re in luck, because below we’re going to take a look at all the important features a new Commander needs to take into consideration when... | Read more »
‘LEGO Star Wars: Castaways’ Is a New Onl...
After a vague tease from the official Apple Arcade Twitter account, LEGO Star Wars: Castaways () by Gameloft was officially announced for release next month on the service. The original teaser Tweet had people speculating about vastly different... | Read more »
Steam Link’s New iOS Update Adds Support...
Ever since Valve brought Steam Link (Free) to iOS following a long period of uncertainty, it has been updated quite a bit with useful features and enhancements. | Read more »
‘Call of Duty Mobile’ Season 9 “Nightmar...
It is Halloween season in all sorts of mobile games, and yes that includes Call of Duty Mobile with the arrival of the Season 9 update this week. In fact, Season 9 is titled Nightmare because it’s soooo spoooooky. The flagship spooky feature is the... | Read more »
SwitchArcade Round-Up: Reviews Featuring...
Hello gentle readers, and welcome to the SwitchArcade Round-Up for October 19th, 2021. In today’s article, we’ve got a couple of reviews that work out to a few more somehow. The latest from Onion Games, Mon Amour, and the recent Cotton Guardian... | Read more »

Price Scanner via MacPrices.net

So… When Will All The NEW Products Apple Anno...
FEATURE: 10.20.21 – By now, you’ve probably heard everything there is to know about the products that were unveiled at Apple’s second Fall product announcement of the year, but when will they finally... Read more
M1 Mac minis on sale for $50-$100 off MSRP at...
Looking for a discount on one of Apple’s popular new Mac minis with Apple M1 Silicon CPUs? These Apple Authorized Resellers are offering $50-$100 discounts on standard mini configurations today. (1... Read more
MacPrices.net launches new Apple 14″ MacBook...
Apple introduced the new 14″ M1 MacBook Pros yesterday (and 16″ models) with an updated design, new 10- to 32-Core M1 Pro and M1 Max CPUs, magic keyboards, edge-to-edge displays, and more. Apple and... Read more
Base 21″ 2.3GHz iMac on sale for $990, plus t...
Expercom has the base 21″ 2.3GHz Dual-Core Intel-based iMac on sale for $990.85 shipped. Their price is $109 off Apple’s MSRP, and it’s the cheapest price for a new iMac from any Apple reseller. You... Read more
On sale again: MagSafe Chargers for up to $25...
Verizon has Apple MagSafe Chargers and Apple’s MagSafe Battery on sale again for up to 25% off MSRP. Verizon service is not required to take advantage of these savings. With the discount, Verizon’s... Read more
Expercom is offering 14″ and 16″ M1 MacBook P...
Apple reseller Expercom is offering discounts on new M1 Pro and M1 Max 14″ and 16″ MacBook Pros ranging up to $305 off Apple’s MSRP. Preorders start today. Order now, and Expercom estimates free... Read more
Expercom offers $50 AppleCare+ discount when...
Apple reseller Expercom is offering a $50 discount on the purchase of an AppleCare+ Plan alongside a new 2021 14″ MacBook Pro or 16″ MacBook Pro with an Apple M1 Pro or M1 Max CPU. Their discount... Read more
Apple drops prices on Certified Refurbished 1...
With the introduction of the 2021 M1 Pro and M1 Max 16″ MacBook Pros, Apple has dropped prices on Certified Refurbished 2020 16″ 6-Core & 8-Core MacBook Pros, with models now available for up to... Read more
Apple to introduce new Macs today, perhaps mo...
Apple is widely anticipated to introduce several new Macs at their special fall event today. Watch their presentation here, at 10am PT. We’re expecting new MacBooks and maybe some new desktops. It’s... Read more
Are The Days Upon Us When Apple (Inc., Not Th...
FEATURE: 10.16.21 – Don’t be surprised if at your next doctor’s appointment, your physician tells you to take two AirPods and call them in the morning. Back in June — in a story from Macworld... Read more

Jobs Board

Sr Infrastructure Engineer - *Apple* MacInt...
**Sr Infrastructure Engineer - Apple MacIntosh** **Description** At Bank of the West, our people are having a positive impact on the world. We're investing where we Read more
Geek Squad Advanced Repair *Apple* Professi...
**836454BR** **Job Title:** Geek Squad Advanced Repair Apple Professional **Job Category:** Store Associates **Store Number or Department:** 000215-Greenspoint-Store Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Operations Associate - *Apple* Blossom Mall...
Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.