• 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: records and property records
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: records and property records


  • Subject: Re: records and property records
  • From: Yvan KOENIG <email@hidden>
  • Date: Thu, 8 Apr 2010 16:26:16 +0200


I guess that it's linked to the class of the properties 's names.
Here I pasted the record grabbed by the
set propRec to (system info) -- from StandardAdditions
instruction. I just changed some values in this message

property defaultPrefsRecord : {something:1, aString:"string", uneListe:{3, 4, 5}} -- for example

property prefsName : "prefsFileName" -- lookup info on CFBundleIdentifier to find out how to name your prefs file
set defaultPrefsRecord to {AppleScript version:"1.10.7", AppleScript Studio version:"1.4.1", system version:"10.4.11", short user name:"yvan_koenig", long user name:"Yvan KOENIG", user ID:999, user locale:"fr_FR", home directory:alias "Macintosh HD:Users:yvan_koenig:", boot volume:"Macintosh HD", computer name:"Power Mac G5 de Yvan_KOENIG", host name:"power-mac-g5-de-yvan-koenig.local", IPv4 address:"111.111.1.111", primary Ethernet address:"00:00:00:00:00:00", CPU type:"PowerPC 970", CPU speed:2000, physical memory:4096}
set propRec to (system info) -- from StandardAdditions
set prefsFolder to (path to preferences folder from user domain)
set posixPath to quoted form of (POSIX path of prefsFolder)
do shell script "defaults write " & posixPath & prefsName & " x y" -- creates the new property list file with dummy value
tell application "Finder" to set prefsFile to (file (prefsName & ".plist") of prefsFolder) as alias
tell application "System Events" to set value of property list file (prefsFile as text) to defaultPrefsRecord


We may see that something, aString, uneListe are treated as standard variable names.

On the other hand, AppleScript version, computer name … are treated as predefined function names

I guess that here is the cause of the different behavior.

Yvan KOENIG (VALLAURIS, France) jeudi 8 avril 2010 16:25:53


 _______________________________________________
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: records and property records
      • From: Luther Fuller <email@hidden>
References: 
 >records and property records (From: Luther Fuller <email@hidden>)

  • Prev by Date: records and property records
  • Next by Date: Re: records and property records
  • Previous by thread: records and property records
  • Next by thread: Re: records and property records
  • Index(es):
    • Date
    • Thread