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

Latest Forum Discussions

See All

Fresh From the Land Down Under – The Tou...
After a two week hiatus, we are back with another episode of The TouchArcade Show. Eli is fresh off his trip to Australia, which according to him is very similar to America but more upside down. Also kangaroos all over. Other topics this week... | Read more »
TouchArcade Game of the Week: ‘Dungeon T...
I’m a little conflicted on this week’s pick. Pretty much everyone knows the legend of Dungeon Raid, the match-3 RPG hybrid that took the world by storm way back in 2011. Everyone at the time was obsessed with it, but for whatever reason the... | Read more »
SwitchArcade Round-Up: Reviews Featuring...
Hello gentle readers, and welcome to the SwitchArcade Round-Up for July 19th, 2024. In today’s article, we finish up the week with the unusual appearance of a review. I’ve spent my time with Hot Lap Racing, and I’m ready to give my verdict. After... | Read more »
Draknek Interview: Alan Hazelden on Thin...
Ever since I played my first release from Draknek & Friends years ago, I knew I wanted to sit down with Alan Hazelden and chat about the team, puzzle games, and much more. | Read more »
The Latest ‘Marvel Snap’ OTA Update Buff...
I don’t know about all of you, my fellow Marvel Snap (Free) players, but these days when I see a balance update I find myself clenching my… teeth and bracing for the impact to my decks. They’ve been pretty spicy of late, after all. How will the... | Read more »
‘Honkai Star Rail’ Version 2.4 “Finest D...
HoYoverse just announced the Honkai Star Rail (Free) version 2.4 “Finest Duel Under the Pristine Blue" update alongside a surprising collaboration. Honkai Star Rail 2.4 follows the 2.3 “Farewell, Penacony" update. Read about that here. | Read more »
‘Vampire Survivors+’ on Apple Arcade Wil...
Earlier this month, Apple revealed that poncle’s excellent Vampire Survivors+ () would be heading to Apple Arcade as a new App Store Great. I reached out to poncle to check in on the DLC for Vampire Survivors+ because only the first two DLCs were... | Read more »
Homerun Clash 2: Legends Derby opens for...
Since launching in 2018, Homerun Clash has performed admirably for HAEGIN, racking up 12 million players all eager to prove they could be the next baseball champions. Well, the title will soon be up for grabs again, as Homerun Clash 2: Legends... | Read more »
‘Neverness to Everness’ Is a Free To Pla...
Perfect World Games and Hotta Studio (Tower of Fantasy) announced a new free to play open world RPG in the form of Neverness to Everness a few days ago (via Gematsu). Neverness to Everness has an urban setting, and the two reveal trailers for it... | Read more »
Meditative Puzzler ‘Ouros’ Coming to iOS...
Ouros is a mediative puzzle game from developer Michael Kamm that launched on PC just a couple of months back, and today it has been revealed that the title is now heading to iOS and Android devices next month. Which is good news I say because this... | Read more »

Price Scanner via MacPrices.net

Amazon is still selling 16-inch MacBook Pros...
Prime Day in July is over, but Amazon is still selling 16-inch Apple MacBook Pros for $500-$600 off MSRP. Shipping is free. These are the lowest prices available this weekend for new 16″ Apple... Read more
Walmart continues to sell clearance 13-inch M...
Walmart continues to offer clearance, but new, Apple 13″ M1 MacBook Airs (8GB RAM, 256GB SSD) online for $699, $300 off original MSRP, in Space Gray, Silver, and Gold colors. These are new MacBooks... Read more
Apple is offering steep discounts, up to $600...
Apple has standard-configuration 16″ M3 Max MacBook Pros available, Certified Refurbished, starting at $2969 and ranging up to $600 off MSRP. Each model features a new outer case, shipping is free,... Read more
Save up to $480 with these 14-inch M3 Pro/M3...
Apple has 14″ M3 Pro and M3 Max MacBook Pros in stock today and available, Certified Refurbished, starting at $1699 and ranging up to $480 off MSRP. Each model features a new outer case, shipping is... Read more
Amazon has clearance 9th-generation WiFi iPad...
Amazon has Apple’s 9th generation 10.2″ WiFi iPads on sale for $80-$100 off MSRP, starting only $249. Their prices are the lowest available for new iPads anywhere: – 10″ 64GB WiFi iPad (Space Gray or... Read more
Apple is offering a $50 discount on 2nd-gener...
Apple has Certified Refurbished White and Midnight HomePods available for $249, Certified Refurbished. That’s $50 off MSRP and the lowest price currently available for a full-size Apple HomePod today... Read more
The latest MacBook Pro sale at Amazon: 16-inc...
Amazon is offering instant discounts on 16″ M3 Pro and 16″ M3 Max MacBook Pros ranging up to $400 off MSRP as part of their early July 4th sale. Shipping is free. These are the lowest prices... Read more
14-inch M3 Pro MacBook Pros with 36GB of RAM...
B&H Photo has 14″ M3 Pro MacBook Pros with 36GB of RAM and 512GB or 1TB SSDs in stock today and on sale for $200 off Apple’s MSRP, each including free 1-2 day shipping: – 14″ M3 Pro MacBook Pro (... Read more
14-inch M3 MacBook Pros with 16GB of RAM on s...
B&H Photo has 14″ M3 MacBook Pros with 16GB of RAM and 512GB or 1TB SSDs in stock today and on sale for $150-$200 off Apple’s MSRP, each including free 1-2 day shipping: – 14″ M3 MacBook Pro (... Read more
Amazon is offering $170-$200 discounts on new...
Amazon is offering a $170-$200 discount on every configuration and color of Apple’s M3-powered 15″ MacBook Airs. Prices start at $1129 for models with 8GB of RAM and 256GB of storage: – 15″ M3... Read more

Jobs Board

*Apple* Systems Engineer - Chenega Corporati...
…LLC,** a **Chenega Professional Services** ' company, is looking for a ** Apple Systems Engineer** to support the Information Technology Operations and Maintenance Read more
Solutions Engineer - *Apple* - SHI (United...
**Job Summary** An Apple Solution Engineer's primary role is tosupport SHI customers in their efforts to select, deploy, and manage Apple operating systems and Read more
*Apple* / Mac Administrator - JAMF Pro - Ame...
Amentum is seeking an ** Apple / Mac Administrator - JAMF Pro** to provide support with the Apple Ecosystem to include hardware and software to join our team and 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
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
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.