Specifications

There are many other options for PlistBuddy that are invoked in a similar manner.
For information about PlistBuddy, see its man page.
Using the defaults command to edit property lists
The defaults tools works directly with the Mac OS X preferences subsystem and is
used by many applications in Mac OS X to manage preferences and other settings.
It can be built into shell scripts and allows you to access preferences in the multiple
domains that exist on a given computer.
1 Determine the names of the appropriate property list, key, and values. For example,
the name for the Dock’s property list is com.apple.Dock.plist. (When invoking the
defaults command, omit the .plist extension.)
2 Using the values you have determined or been given, enter their values following the
defaults command:
defaults write com.apple.dock orientation left
3 In most cases, you need to restart the application or process. A simple way to do this is
to use Activity Monitor to select the appropriate process, and then click Quit Process.
For this example, you would choose the process named Dock.
For information about defaults, see its man page.
Using plutil and a text editor to edit property lists
In Mac OS X v10.6, plist les are stored in a binary format. If you want to edit them with
a text editor, you must rst convert them to plain text. To convert a plist le to plain
text, use the plutil command:
plutil -convert xml1 com.apple.dock.plist
This results in an XML text le that you can edit. When you’re done, convert the le
back to binary format:
plutil -convert binary1 com.apple.dock.plist
Before making any changes to plist les using plutil, make a backup copy of the les.
Do this in the Finder, or use the cp command:
cp com.apple.finder.plist com.apple.dock.plist.bak
For information about Property Lists, see the plist man page. For the basics of using
command-line tools, see Chapter 1,Introduction to the Command-Line Environment.”
38 Chapter 5 Common Command-Line Tasks