This is helpful.
I don't think the syntax is very discoverable, so every working example helps.
PlistOpen has a string parameter. Is it able to take a string of xml data? If so what would be the syntax?
Thanks.
-------------------------------------------------------------------------------------------
# Alias to binary Plist File
-------------------------------------------------------------------------------------------
set plistAlias to alias ((path to downloads folder as text) & "cc.omh.Clyppan.plist")
-------------------------------------------------------------------------------------------
# Getting keys from a plist file directly:
-------------------------------------------------------------------------------------------
set _plist to PlistOpen plistAlias
set _keys to PlistGetKeys (PlistNew _plist)
PlistClose _plist
_keys
-------------------------------------------------------------------------------------------
# Getting keys from a simple record:
-------------------------------------------------------------------------------------------
set _record to {key1:"Value1", key2:"Value2"}
set _keys to PlistGetKeys (PlistNew _record)
-------------------------------------------------------------------------------------------
# Getting keys from a record (creating a record for the example using 'plutil' and
# System Events) - just to test a more complex record.
-------------------------------------------------------------------------------------------
set _plist to do shell script "plutil -convert xml1 -o - " & quoted form of POSIX path of plistAlias
tell application "System Events"
set _record to value of (make property list item with properties {text:_plist})
end tell
set _keys to PlistGetKeys (PlistNew _record)
-------------------------------------------------------------------------------------------