Re: Plist entry
Re: Plist entry
- Subject: Re: Plist entry
- From: Axel Luttgens <email@hidden>
- Date: Sat, 19 Jan 2008 12:58:25 +0100
On 19/01/08 10:54, Michael Ghilissen wrote:
Hi List,
In Leopard 10.5.1, I need to create a plist of cookies (Safari) and
add several <dict>...</dict> entries. With the following script, I
can only create one entry. I am missing something. Can you help?
tell application "System Events"
set the parent_dictionary to make new property list item with
properties {kind:record}
set the plistfile_path to "~/Desktop/example.plist"
set this_plistfile to make new property list file with properties
{contents:parent_dictionary, name:plistfile_path}
-- add first property list items
make new property list item at end of property list items of
contents of this_plistfile ¬
with properties {kind:number, name:"numberKey", value:5}
-- I NEED A NEW <dict>...</dict> ENTRY HERE and make new property
list item with properties {kind:number, name:"numberKey", value:6}
not overriding the previous entry.
end tell
Hello Michael,
Above code creates this plist:
<?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>numberKey</key>
<integer>5</integer>
</dict>
</plist>
Could you complete it so as to exactly show us how you want it to be
extended?
TIA,
Axel
_______________________________________________
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
References: | |
| >Plist entry (From: Michael Ghilissen <email@hidden>) |