Plist entry

In Leopard, I need to create a plist of cookies (Safari) and add several 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 new property list items of each of the supported types
	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}
end tell

AppleScript: SE 2.2
Browser: Safari 523.10.6
Operating System: Mac OS X (10.5)

Moving to OS X…

Ooops! Sorry

Any thought on the syntax to add an entry in the plist using System Events?


what’s about user defaults?

do shell script "defaults write ~/Desktop/example testkey -dict kind number name numberKey value -int 5"