• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

defaults

defaults

defaults Accesses the Mac OS X user defaults system.
defaults read [ <domain name> [ <key> ] ]

defaults write <domain name> [ { '<domain rep>' | <domain name>
									<key>
'<value rep>'}

defaults delete [ <domain name> [ <key> ] ]

defaults {domains | find <word> | help }

defaults allows users to read, write, and delete Mac OS X user defaults from the command line. Applications use the defaults system to record user preferences and other information that must be maintained when applications aren't running, such as the default font for new documents. Because applications access the defaults system while they are running, you should not modify the results of a running application.
User defaults belong to <domains>, which typically correspond to individual applications. Each domain has a dictionary of keys and values to represent its defaults. Keys are always strings, but values can be complex data structures comprised of arrays, dictionaries, strings, and binary data.
Although all applications, system services, and other programs have their own domains, they also share a domain called NSGlobalDomain. If a default is not specified in the application's domain, it uses the default listed in the NSGlobalDomain instead.
read Prints all of the user's defaults for every domain to standard output.
read <domain name> Prints all of the user's defaults for the specified <domain name> to standard output.
read <domain name> <key> Prints the value for the default of the <domain name> identified by <key>.
write <domain name> <key> '<value rep>' Writes <value rep> as the value for <key> in <domain name>. <value rep> must be a property list, and must be enclosed in single quotes. For example:
defaults write MyApplication "Default Color" '(255, 0, 0)'

sets the default color in MyApplication to the array containing 255, 0, 0 (red, green, blue components). Note that the key is in quotes because of the space in its name.
write <domain name> '<domain rep>' Overwrites the defaults information in <domain name> with that specified in <domain rep>. <domain rep> must be a property list representation of a dictionary, and must be enclosed in single quotes. For example,
defaults write MyApplication '[ "Default Color" = (255, 0, 0); "Default
Font" = Helvetica; }  '

overwrites any previous defaults for MyApplication and replaces them with the ones specified.
delete <domain name> Deletes all default information for <domain name>.
delete <domain name> <key> Deletes the default named <key> in <domain name>.
domains Prints the names of all domains in the user's defaults system.
find <word> Searches for <word> in the domain names, keys, and values of the user's defaults, and prints out a list of matches.
help Prints a list of possible command formats.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint