• 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: (no subject)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (no subject)


  • Subject: Re: (no subject)
  • From: Luther Fuller <email@hidden>
  • Date: Wed, 31 Mar 2010 18:59:14 -0500

On Mar 31, 2010, at 6:05 PM, Shane Stanley wrote:

On 1/4/10 9:40 AM, "Luther Fuller" <email@hidden> wrote:

Do you have a line of code that's known to work?

This gives no error, but the resulting file is empty:

set deskAlias to path to desktop
tell application "System Events" to make new property list file at end of
files of deskAlias with properties {name:"Testing.plist"}

Perhaps providing other properties or data might give something useful, but
after a bit of a play, I'm not confident.

I did a little experimenting with this ...

property defaultPrefsRec : {a:1, b:"str", c:true, d:{1, 2, 3}}
set deskAlias to path to desktop
-- tell application "System Events" to make new property list file at end of files of deskAlias with properties {name:"Testing.plist"}
tell application "Finder" to set prefsFile to (file "Testing.plist" of deskAlias) as alias
tell application "System Events" to set value of property list file (prefsFile as text) to defaultPrefsRec -- <<<<<<< WRITE

The file created in the line now commented out seems to be broken.

A preference .plist file I created with the code I posted earlier, when opened with TextEdit, shows a header

bplist00รท

followed with data that I can recognize. The "Testing.plist" file shows simply

{
"New item" = "THIS IS A TEST..";
}

which is data I entered manually via PLE. The code above fails at the last line and the content of the "Testing.plist" file is erased.

I'm now confused, but suspect that System Events does not know what a property list file is.

 _______________________________________________
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: Property lists and System Events (was: no subject)
      • From: hd <email@hidden>
References: 
 >Re: (no subject) (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: (no subject)
  • Next by Date: Re: Property lists and System Events (was: no subject)
  • Previous by thread: Re: (no subject)
  • Next by thread: Re: Property lists and System Events (was: no subject)
  • Index(es):
    • Date
    • Thread