Wednesday, November 27, 2002


Fun with defaults...

One of the features of the 'defaults' command line tool found on any install of OS X is the ability to set defaults based on type. For example, many applications expect certain defaults to be a boolean or float type.

This feature is not documented beyond a passing mention in the usage for defaults (not even in the man page).

For example:

defaults write com.apple.dock magnification -boolean true
defaults write com.apple.dock largesize -float 500.00

Once done, kill and restart the Dock. The TextEdit icon looks like it has a "Dear John," letter on it.

Supported types include string, data, int[eger], float, bool[ean], date, array and dictionary. -array-add and -dictionary-add can be used to specific an array/dictionary type and to append the data found on the command line to an already existing array/dictionary default value.
12:59:59 PM