PlistEdit Pro Icon

Property list definitions

A property list definition is itself a property list (with a file name ending in ".plistDefinition") that specifies what data can be held by various keys in a certain type of property list. The root dictionary of a plistDefinition file can have the following keys:

Root dictionary

FileExtension

String

This specifies what file extension file that conform to the definition should have. This key is optional

FileName

String

This specifies the full name of a file that conforms to the definition should have. This key is optional

Name

String

This specifies the name of the definition that will be displayed in PlistEdit Pro's interface. This key is optional, and if not present, the name of the file (minus the .plistDefinition extension) will be used as the name instead.

DefinitionElements

Dictionary

This dictionary contains the information that describes how the property list should be structured

Each dictionary in the DefinitionElements dictionary can have the following keys, which are required unless otherwise noted:

Definition element dictionary

Class

String or Array of Strings

This specifies what class(es) the data item should be and should be one or more of the seven basic types (Array, Boolean, String, etc.)

DictionaryKeyTypes

Dictionary

This key is only required if the Class key specifies that the data item is a Dictionary.

The values stored in this dictionary specify what type of data should be stored under a particular key. This can be either one of the seven basic types or the name of a definition element that is defined in the DefinitonElements dictionary of the plist definition. You can also specify multiple types with an array of strings instead of a single string.

This value can also be of the form Array<type> or Dictionary<type>. This specifies that the value should be an array or dictionary, respectively, and each child of that value should be assigned the definition element type, where type can be any other valid definition element name.

You can specify the default data type to use (i.e. for any key, not just the ones specified in DictionaryKeyTypes) by adding an entry under the key "", i.e. an empty string. You can also specify that a certain key can be of any type by specifying the empty string as the value under that key.

ArrayElementType

String

This key is only required if the Class key specifies that the data item is an Array.

The value of this key specifies a single type that all the elements of the array should be. As with DictionaryKeyTypes, this can be one of the seven basic values, a definition element name, or the empty string.

DefaultValue

Varies

This key can be used to specify the default value that data items associated with this definition element should take when first created. The class of the default value should match the class specified by the Class key. This key is optional.

AllowableValues

Dictionary

If you wish to restrict not only the type but the complete range of values that data associated with the element can take, this will allow you to specify that list of values. When editing an item of this element, the value column will display a pop-up menu allowing the user to select one of the values. One menu item will be present for each object in this dictionary: the key of the object will be used as the menu item's title, and selecting that item from the menu will assign the value for that key to the data item.

PreviewKeyPath

String

Applicable only to dictionaries. The value stored in the dictionary under the given key path will be displayed in the value column of the dictionary itself. When viewing a list of dictionaries, this can make it much easier to distinguish the dictionaries from one another without having to expand each one to see its contents. This key is optional.

Note that PlistEdit Pro ships with a property list definition that defines the structure of .plistDefinition files. Comparing this definition to the specification above can be helpful in understanding how property list definitions work. You can open this definition from the Definitions tab in the preferences window.

See also:

Property List Definitions

Property List Definition Example