JNSoftware
script icon
Version: 1.1.8
Release Date: November 6, 2007
Requirements: Mac OS X 10.2+ with BSD Subsystem installed
Script Type: Run-Only
License: Freeware (GPL) — Contributions Encouraged
Installation: Download, expand, and place in your Applications folder (or anywhere, really).
Macworld 4 Mice Rating
versiontracker logo
 Downloads
Add a Comment
News
We’ve started to add foreign language localizations to Preferential Treatment. If you are a native speaker of a non-English language and are interested in helping with this effort, .
Preferential Treatment has garnered quite a bit of attention, which is gratifying. It has been chosen as a Macworld Magazine Mac Gem in the August 2004 issue (and was mentioned again in the October 2004 & February 2005 issues), it’s been featured in Ted Landau’s Mac OS X Help Line, Panther Edition (and is part of Ted’s “Top Ten Troubleshooting Tips for Panther”), it has been the software “Pick of the Week” at www.macosxhints.com, the “Utility of the Month” at www.macfixit.com, featured on the “Mac OS X Tip-of-the-Day” at www.osxfaq.com, and has been very favorably reviewed at www.versiontracker.com and www.macupdate.com. Thanks for the encouragement!
Introduction
Building on a discussion at www.macintouch.com, this application will check your preference files (both in your user’s preference folder and the system’s preference folder) for corruption by using the “plutil” command line tool. If it finds suspect files, it will list the files and allow you to reveal them in the Finder or move them to the trash. You may also double-click on a file in the found files table to open it in the application of your choice (you can designate the default application from the preferences). There is also an option to save the results of a scan to a text file. (Note: if you trash a file before saving a report, the report will not include information on the file you moved to the trash.)
“Preferential Treatment” is basically a GUI wrapped around the “plutil” command line tool provided by Apple, Inc. since Mac OS X 10.2 (see “man plutil” in the Terminal). “plutil” just checks to see if .plist files are valid XML. This application is no panacea but it does help to fix blatantly corrupt preference files.
Authentication
There are some files that require administrative permission for this application to check them properly. If the account from which you run this application is not in the admin group, you will not be able to check these files. For this reason, for maximum benefit, it is highly recommended that you run this application from an administrative account.
If you run a check and you receive a message to the effect that you don’t have permission to read a file, you should authenticate the application with your administrative password. This will only be an option if you are using an account that is a member of the admin group. If so, to authenticate, simply click on the “lock” button at the top right corner of the main window. This will bring up an authentication dialog that will allow you to enter your password. This password will be used for scanning both the user and system preference folders so there is no need to modify the main script to include “sudo” from the preferences.
If you are not using an account that is a member of the admin group, currently there is no way to specify the account to use when scanning so even if you know the administrative password, the authentication will fail from this account. Therefore, when using “Preferential Treatment” from an account that is not a member of the admin group, the “lock” button will not be visible. Hopefully this will be rectified in a future release. (If your current account is not a member of the admin group but you have manually added it to the sudoers list, you can still attempt to authenticate the application from the current account by Option-clicking the “Check Preferences” button.)
Notes
  • Before you move a preference file to the trash, you should quit the associated application if it is open. You should use your best judgment before deleting a preference file. In most cases, it is safe to do so and the associated application will simply regenerate a preference file based on the application defaults.
  • Deleting the preference file (.plist) of some applications may mean you will have to re-enter a registration code and/or preferences (such as server and network settings for Mail.app) for the deleted preference file’s application to work properly.
  • If you move one or more system preferences to the trash, it is probably a good idea to immediately restart your system.
  • You must have administrative permission to open many system preferences—even to use this application to scan them for corruption.

    For instance, the files in the folder “/Library/Preferences/DirectoryServices/” (“ContactsNodeConfig.plist”, “DirectoryService.plist”, “DSLDAPv3PlugInConfig.plist”, & “SearchNodeConfig.plist”) may be listed as corrupt when using the application.

    If you authenticate “Preferential Treatment” and then scan the preferences, this runs the “plutil” as sudo which should eliminate the permissions issue and allow the files to be parsed properly returning no error—unless, of course, there are errors with these files unrelated to permissions.
  • If you try to open a flagged file for which you do not have read privileges, you may receive an error from the target application indicating the permissions error. This may happen even if you have authenticated “Preferential Treatment”, perhaps because you have not authenticated the target application.
  • Some people have noticed that there are preference files in their user preferences that they do not have permission to read. Some applications write their preference files as the main administrative user for the system (“root”) so they can function at the lowest possible level to fix your system (i.e., root). This is why these applications (such as TechTool Pro or DiskWarrior) ask for your password either when they run or when they are installed and, in some cases, why they must be run from an external volume such as a CD. This is not a problem, per se, and as long as you authenticate “Preferential Treatment”, it should be able to determine if their preference files are valid XML.
Preferences
You may set the folders that the application searches. For most users, the defaults will suffice. If you are using a server or NetBoot environment, however, your preference files may be in a unique location and you can tell the application to search that location by selecting “Preferences...” from the application menu and specifying the appropriate folder(s) as necessary.
The other settings in the preferences are fairly straightforward. You may choose the default application “Preferential Treatment” uses when you double-click a flagged file and the creator code for the text file of the saved reports (“R*ch” is the code for BBEdit, a terrific text editor. It doesn’t suck.)
Version History
  • v1.1.8 (PT)
    • Fixed a minor Mac OS X 10.5 (Leopard) incompatibility that prevented the application from recognizing administrative user accounts.

  • v1.1.7 (PT)
    • Updated to Universal Binary.
    • Italian localization by Creative Shield.
    • Vietnamese localization by Clytie Siddall.
    • Minor code & interface improvements.
    • Includes script for running any application as an administrator (as long as proper credentials are provided). This is useful as some users have problems authenticating within Preferential Treatment itself.

  • v1.1.6 (PT)
    • Fixed an error that occurred when trying to authenticate on some non-English systems.
    • Fixed an error that resulted from scanning plist files whose name included an apostrophe.
    • Updates to the French localization by Ronald Leroux.

  • v1.1.5 (PT)
    • Improved compatibility with Mac OS X 10.4.3 (Tiger).
    • Added the ability to specify the user name of the admin account when authenticating (Mac OS X 10.4+-only).
    • Minor code & interface improvements.

  • v1.1.4 (PT)
    • Added Mac OS X 10.4 (Tiger) compatibility.
    • French localization by Frédéric Tétart.
    • Added better error handling when trying to check files not owned by the current user.
    • Minor code & interface improvements.

  • v1.1.3 (PT)
    • Fixed an error that stopped scans on files with high-ASCII characters in their names on some machines.

  • v1.1.2 (PT)
    • German localization by Stefan Hartmann.
    • Spanish localization by Pescados Software.
    • Better error reporting if the scan encounters permission errors.
    • Better error reporting if plutil is not found (the BSD Subsystem is most likely not installed).

  • v1.1.1 (PT)
    • Improved compatibility on systems with FileVault enabled.

  • v1.1 (PT)
    • Improved compatibility on some non-English systems.
    • Eliminated the ability to customize the script that is run to minimize security issues.
    • Added the option to include every file checked (even files with no problems) to the results table (see preferences).
    • Improved progress bars.
    • Added the ability to cancel a scan in progress.
    • Added links to the plutil man page (see the Help menu).
    • Improved performance on 10.2.x systems with constrained RAM.
    • Minor interface tweaks.
    • Note: Some enhancements may result in slower file scans compared to earlier versions. For this reason, v1.0.2.1 is still available for download here.

  • v1.0.2.1 (PT)
    • Improved performance on some non-English systems.
    • Added original default script to the list of known scripts so that it wont raise an alert if the user has not updated the main script to the current default.
    • Added longer timeouts for dialogs.

  • v1.0.2 (PT)
    • Addresses a potential security concern through improved validation.

  • v1.0.1 (PT)
    • Minor interface tweaks.

  • v1.0 (PT)
    • Rebranded “Check Preference Files” as “Preferential Treatment”; aside from the name and version number, there are no changes in this version.

  • v1.6.9 (CPF)
    • Added an Option-click manual authentication for users whose current account is not in the admin group but has been manually added to the sudoers list.
    • Augmented alert text.
    • Clarified the authentication help text.
    • Adjusted the column widths to display more problem text to eliminate the text being truncated. If the text does appear to be cut off, try expanding the window.
    • Some very minor interface tweaks.

  • v1.6.8 (CPF)
    • Added a .plist viewer/editor. Option-click on a flagged file to open the .plist file in the viewer. This is a work in progress so for now, the save function is disabled. It is still useful for viewing plists directly in the application. Some Unicode characters may not display correctly. Again, you may need to authenticate to preview files owned by other accounts.
    • Fixed the hotkeys so standard edit commands work correctly.
    • The application should now accept blank passwords if you never assigned a password to your administrative account.
    • At launch, it checks to see if your current account is in the admin group. If not, you will receive a warning: “Your current account is not an administrative account and, as such, you may not be able to check some files. It is recommended that you run this application from an administrative account.”
    • Fixed a few minor bugs.
    • Added more help text.

  • v1.6.7 (CPF)
    • We really hope this is the last update for a long time, but in case it isn’t, I’ve added a version checking feature to see if you are using the latest version of “Preferential Treatment”. It will never connect to the server unless you ask it to and it does not pass any information about your machine, it simply downloads the latest version number, and, if you wish, the latest build.
    • Fixed an obscure and rare error related to a timeout if you ran a second authenticated check after the timed limit without re-authenticating.

  • v1.6.6 (CPF)
    • You can now run the check on either the user or system preferences with administrative privileges. Just click the “lock” icon to authenticate. (This means there is no longer a need to modify the main script to include “sudo” from the preferences to have the app run with administrative privileges on your user preference folder.)
    • Improved the problem text to include information about ownership if you are not the owner.
    • Significantly re-wrote and augmented the help file—please read it before sending in questions! To read it, see the “Help” menu or click Command-?.

  • v1.6.5 (CPF)
    • Moving selected files to the trash from the selection menu will now remove those files from the flagged file table. If you wish to save a report, however, it is best to do it before you move files to the trash because once you do, any report saved subsequently will not include the files that you trash.

  • v1.6.4 (CPF)
    • Changed the authenticate button from just the lock icon to an actual round button to make it more obvious.
    • Improved error handling and notification.
    • More minor code & interface tweaks.
    • The package is now released on a disk image which should eliminate errors incurred on some systems when expanding using StuffIt 8.0.x.

  • v1.6.3 (CPF)
    • Lots of minor code tweaks.

  • v1.6.2 (CPF)
    • Fixed an authentication bug introduced in v1.6.1 if you modified your main script to include “sudo”.

  • v1.6.1 (CPF)
    • Tabs. Don’t know why we didn’t think of that earlier.

  • v1.6 (CPF)
    • Fixed 10.2.x compatibility issues. Hopefully.
    • If you wish, you may now modify the main script to always run with “sudo” (modify the main script in the preferences, “sudo” should be placed before “xargs”, e.g., “sudo xargs”). This allows you to check user preferences with administrative privileges. If you don’t add this to the main script, when you authenticate and check the system preferences, it will automatically be added (though not when checking user preferences).
    • You can now open—or at least try to open—a plist file by double clicking on the appropriate row in the found corrupt files tables. You may specify the application to use when opening these files from the preferences window.
    • Added the ability to save the reports as stand alone text files.
    • Improved the results by further checking permissions and file types.
    • Added a basic help screen.
    • Many minor code optimizations.
    • Took the code source offline. If you would like access to the source code, please contact us.

  • v1.5.2 & v1.5.3 (CPF)
    • Minor fixes. Still trying to track down some bugs that have cropped up on 10.2.x systems. Stay tuned...

  • v1.5.1 (CPF)
    • More interface tweaks.

  • v1.5 (CPF)
    • Now gives a limited report of errors found in corrupt files (if any).
    • Allows you to authenticate via an admin password before scanning (eliminating an annoying double scan).
    • Interface tweaks.

  • v1.0 - v1.4.x (CPF)
    • Conversion from simple AppleScript to an AppleScript Studio application. Too many changes to document.
Thank You
To the many folks who have written to express their gratitude and especially to those who have opened their wallets to show their appreciation, we want to say a special thank you. —JN