Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 12.2   12.3   12.4   12.5   13.0   13.1   13.2   13.3   13.4   13.5    Statistic    FMM    Blog  

PList.WriteData

Encodes property list data.

Component Version macOS Windows Linux Server iOS SDK
PList 11.4 ✅ Yes ❌ No ❌ No ✅ Yes, on macOS ✅ Yes
MBS( "PList.WriteData"; JSON )   More

Parameters

Parameter Description Example
JSON The data with the JSON data as input.

Result

Returns text or error.

Description

Encodes property list data.
Takes JSON and produces matching property list in XML format.
You can write this into a plist file with Text.WriteTextFile in UTF-8 encoding.

You can use PList.ReadData to convert back from plist to JSON.

Examples

Convert JSON to Plist:

MBS( "PList.WriteData"; "{\"id\":1234}" )

Example result:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>id</key>
  <integer>1234</integer>
</dict>
</plist>

See also

Blog Entries

This function checks for a license.

Created 29th August 2021, last changed 29th August 2021


PList.ReadFile - PageSetupDialog.ClearOption

💬 Ask a question or report a problem