Application icon

Read/Write Plist File

This statement can read a plist (property list) file (XML or binary) into a container and can also write any container as a plist file.

Both of the supplied strings may contain any of the escape sequences described in Escape Sequences. The resultant file path may be absolute (/), relative to the Home folder (~/) or relative to the track's containing folder (./) or (../). Any path which does not exist or is invalid is ignored.

While this statement is valid in all execution modes, it will typically be performed in stepwise mode so that the file is read only once. When run stepwise any track variables referenced in the supplied strings are taken from the first selected file and a relative path is relative to that same file.

If the file is successfully read or written the action test state will be set to true. A test state of false implies that the container name was invalid or the read or write failed.

After successfully reading a plist file, the named variable Read Text File Encoding will be set to XML plist or Binary plist. On failure the named variable will be empty.

When writing a plist file, you can specify that your want to write an XLM or binary file.


Special Considerations: Please read

Yate containers are intended to be mappings to JSON data. However, Mac plist files can contain the additional data types of dates and data which cannot be represented as such in JSON. When reading a plist file with this statement, dates and data types are retained. However you cannot create them with container statements. You can enumerate them, extract a description of their values and delete them. When converting a container to JSON text, these data types are converted to Strings. It is not a good idea to use these statements to edit and change an application's preference plist file.