• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Plist entry
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Plist entry
      • From: Michael Ghilissen <email@hidden>
References: 
 >Plist entry (From: Michael Ghilissen <email@hidden>)

  • Prev by Date: Re: "a reference to"
  • Next by Date: Re: Plist entry
  • Previous by thread: Plist entry
  • Next by thread: Re: Plist entry
  • Index(es):
    • Date
    • Thread