The easiest would probably be to use some AppleScriptObjC (System Events gets a bit convoluted), for example:
use framework "Foundation"
use scripting additions
set testRecord to {SomeText:"this is some text", SomeNumber:42, SomeBoolean:false, SomeList:{"zero", "one", 2, 3, 4.0, 0.5}, SomeDict:{AnotherList:{"another 1", "another 2", 3}}}
set testList to {"test item 0", "test item 1", "test item 2"}
makePlist for testList at (choose file name default name "Untitled.plist")
to makePlist for plistItem at filePath -- write a record/list to an XML property list file
set filePath to POSIX path of (filePath as text)
set plistData to current application's NSPropertyListSerialization's dataWithPropertyList:plistItem format:(current application's NSPropertyListXMLFormat_v1_0) options:0 |error|:(missing value)
return (plistData's writeToFile:filePath atomically:true) as boolean -- success?
end makePlist
Topic:
App & System Services
SubTopic:
Automation & Scripting
Tags: