Re: Creating a plist file in Applescript
Re: Creating a plist file in Applescript
- Subject: Re: Creating a plist file in Applescript
- From: Shane Stanley <email@hidden>
- Date: Tue, 01 Oct 2013 23:52:14 +1000
On 01/10/2013, at 11:17 PM, Jim Brandt <email@hidden> wrote:
So, my question is, is there a way to initialize, from Applescript, a plist file that is an array of arrays with no key?
Yes (by definition, an array has no key). You don't need anything more than System Events, and rather odd use of the name property:
set theList to {{"a", "b", "c"}, {"d", "e", "f"}} set thePath to POSIX path of ((path to desktop as text) & "Test.plist") tell application "System Events" set theArray to make new property list item with properties {kind:list, value:theList} set theFile to (make new property list file with properties {contents:theArray, name:thePath}) end tell
-->
<?xml version="1.0" encoding="UTF-8"?> <plist version="1.0"> <array> <array> <string>a</string> <string>b</string> <string>c</string> </array> <array> <string>d</string> <string>e</string> <string>f</string> </array> </array> </plist>
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden