Property Lists
User-defined property lists are stored in ~/Library/Preferences, and the appropriate plist is called up when an application launches. Property lists can contain literal preferences set through the application’s ApplicationPreferences dialog, or subtler things such as window coordinates or the state of an option (such as whether to display the battery menu extra in the menu bar, as shown in Example 13-1).
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.
com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ShowPercent</key>
<string>YES</string>
<key>ShowTime</key>
<string>NO</string>
</dict>
</plist>Each property list is named after its domain, the unique namespace that an application uses when working with its preference files
. Domains can look like any string, but the Apple-recommended format is similar to a URL, just in reverse. The naming convention is based on the developer’s company or organization’s name, using the application’s name as the domain. All of the plist files for the System Preferences and other iApps use the syntax com.apple.
domain
.plist, where domain is the name of the service or application. For example, the plist file for the Dock’s preferences is com.apple.dock.plist, while the preferences file for OmniGraffle
(if you have it installed) is com.omnigroup.OmniGraffle.plist.
Tip
Not all application ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access