Re: How to add new property list item into a property list file.
Re: How to add new property list item into a property list file.
- Subject: Re: How to add new property list item into a property list file.
- From: Luther Fuller <email@hidden>
- Date: Sun, 3 Sep 2006 20:03:57 -0500
Here's one way ...
tell application "System Events"
set thePlistFile to property list file thePath
set fileRec to (value of property list file thePlistFile)
end tell
set fileRec to fileRec & {newName:newValue}
tell application "System Events"
set value of property list file thePlistFile to fileRec
end tell
When you read/write the value of the plist file, you are reading/
writing the value of 'root' which is usually of type 'Dictionary'. (A
plist "Dictionary' is equivalent to an AppleScript 'record'.)
On Sep 3, 2006, at 7:39 PM, Tetsuro KURITA wrote:
I was trying to add a new property list item into a property list
file using
Property List Suite of System Event. The code is as follows.
tell application "System Events"
set thePlistFile to property list file thePath
make new property list item at end of contents of
targetPlistFile with properties {value:"theValue", name :"theName"}
end tell
No error happen, but no new entry is not created in the plist file.
How to
add new entry into a property list file ?
=======================================================
Tetsuro KURITA
E-mail: email@hidden
=======================================================
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (Applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden