The Power of Preferences

Safari crashes on launch. Mail quits when you try to send a message. What to do? Most savvy Mac users will delete the application’s preferences file, which stores changes made to the program’s default settings. This creates a new (and hopefully problem-free) copy of the file, with default settings restored, the next time the application is launched. But you can do far more with these files. Editing OS X preferences files (also known as property list or .plist files) unlocks hidden features you can’t access any other way.

Preferences files are plain-text files, so you can view or edit them in any text editor. But because they’re written in XML format, it’s easier to use a utility designed to interpret and format XML—just as using Adobe GoLive to edit HTML files is easier than using TextEdit to do so. Apple’s Property List Editor does the trick (see “Cool tools” on the next page for details). Once you’ve installed it, it’ll be in the Applications folder inside the Developer folder at the root level of your drive.

Sync your bookmarks

The first time you launch Safari, it automatically imports bookmarks from Microsoft Internet Explorer. If you still use Explorer and continue to add bookmarks, at some point you might want to import your updated list. At first glance, you won’t see a way to do this, but appearances are misleading. All you need to do is convince Safari you’re launching it for the first time, and it will import your latest Explorer bookmarks. Safari’s preferences file holds the key.

You can trash the com.apple.Safari.plist file, and Safari will import bookmarks on its next launch. But this also eliminates any other preferences changes you’ve made via Safari’s Preferences command. A more elegant solution is to delete or modify just the right item in the preferences file:

1. Quit Safari if it’s open.

2. Locate com.apple.Safari.plist by selecting Go To Folder from the Finder’s Go menu and entering

~/Library/Preferences
. This will take you to the Preferences folder in your Home directory’s Library folder. Double-click on the file to open it in Property List Editor. (If it doesn’t open in Property List Editor, drag the .plist file icon to the Property List Editor icon in the Finder.)

3. In the Property List column, click on the disclosure triangle next to the word Root.

4. Scroll through the items that appear, and find the IEFavoritesWereImported property. (There’s a related one for Netscape called NetscapeAndMozillaFavoritesWereImported, but we’re concerned only with Explorer right now.)

5. Either select the IEFavoritesWereImported property and click on the Delete button, or select the pop-up menu in the Value column of the IEFavoritesWereImported item and change Yes to No.

6. Save your changes and close the document.

The next time you launch Safari, it will import Explorer’s current bookmarks and add the IEFavoritesWereImported property (if you deleted it), with its value set to Yes. If you’ve previously imported bookmarks from Explorer and haven’t deleted them, the newly imported URLs will merge with the existing list.

NOTE: Under some circumstances, a bug makes IEFavoritesWereImported invisible in Property List Editor. If that happens, never fear—open the preferences file in a text editor, such as TextEdit. Look for these lines:

<key>IEFavoritesWereImported</key>

<true/>

Change them to this:

<key>IEFavoritesWereImported</key>

<false/>

Make the Finder anew

Maybe you’re a Unix geek and spend most of your time in Terminal, so you’d like it to replace OS X’s Finder completely, launching whenever the Finder would (at login, for instance). Or perhaps you want to do the same thing with a Finder alternative, such as Cocoatech’s $34 Path Finder utility (   , July 2004 ). A trip to Property List Editor will grant your wish.

1. Select Go To Folder from the Finder’s Go menu and enter

~/Library/Preferences
. This will take you to the Preferences folder in your Home directory’s Library folder. Find com.apple.loginwindow.plist and open it in Property List Editor.

2. Click on the triangle next to the word Root.

3. Then, with Root selected, click on the New Child button.

4. A new New Item property will appear. Change its name to Finder.

5. Double-click in the Value column to make the field active. Then enter the absolute path for the application you want to launch. For example, if you wanted Terminal to launch by default, you would type

/Applications/Utilities/Terminal.app
.

6. Save your changes and close the document.

To test your change, log out and log back in. When you do so, Terminal should launch. You can still launch the real Finder by clicking on its icon in the Dock. To undo your change, delete the Finder property from the preferences file.

TIP: How do I know about this Finder property if it isn’t present in the default preferences file? Apple revealed its existence on the Apple developer Web site.

Too geeky to use the plain old Finder? Make Terminal launch at login by tweaking the right preferences file. Use Property List Editor to add the highlighted line to your com.apple .loginwindow.plist file.
1 2 3 Page 1
Page 1 of 3
Shop Tech Products at Amazon