A script to manage system-wide services

Sep 20, '03 01:51:00PM

Contributed by: Anonymous

This shell script will allow you to turn on or off the system-wide services for all applications. For each application, you can turn all of its services on or off. By disabling unused services, you will have a much less cluttered menu, and maybe faster login (is it faster?). All modifications to the info.plist files in your applications are backed up in your applications. This means that you can move your applications around after modification, or do whatever you want with them -- you just have to regenerate the application list with the script before newly enabling or disabling services (if you moved some NSS applications).

Download the script (see Rob's note below) into a text file, save it as /bin/nss, or somewhere else in your path. Open the Terminal and type chmod +x /bin/nss, and then rehash. Now you can start the program by just typing nss.

one last note: if you move a modified app out of the folders that are watched for (NS) services apps = those that are checked by the script to generate the app-list, then you can't reenable the services anymore because the script does not find the app. just move the app somewhere in the searched folders and regenerate the app-list. the searched folders are: /Applications, /Library, /System/Library, ~/Applications, and ~/Library.

[robg adds: This script appeared as a comment to an older hint about removing items from the services menu, but I felt this was a unique-enough solution that it merited publishing on its own. Due to the length of the script, I uploaded it to macosxhints as a separate Stuffed text file -- nss.sit [2kb]. Expand the archive and follow the directions in the "Download the script..." paragraph above.

When you first run the script, you'll be asked to authenticate, and then it searches for all installed apps, then digs out those with services. At that point, you can choose to skip the core services from the next step (ie you'll never want to disable the core services), and then you're offered the chance to enable or disable each application's services one at a time. Overall, this is a much nicer solution than hand-editing plist files ... now, if someone would just wrap it in a GUI :)...]

Comments (14)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030915093123536