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. |
|
|
ArrayElementType |
String |
This key is only required if the Class key specifies that the data item is an Array. |
|
|
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: