• 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: names of a record's items
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: names of a record's items


  • Subject: Re: names of a record's items
  • From: "koenig.yvan" <email@hidden>
  • Date: Wed, 09 Apr 2014 22:34:49 +0200


Le 09/04/2014 à 21:48, Alex Zavatone <email@hidden> a écrit :

Just tested on 10.8.5 with your exact code using system info as the variable and the file doesn't write at all.

I have written out arrays into a pList with no problem.

Are your records that you successfully write to a pList using strings as property names?

Running this code (which calls your routine) under 10.8.5 fails to create a file on the desktop.

on run {}
  set myThing to (system info) as record
  writeRecordToPlist(myThing)
end run

on writeRecordToPlist(aRecord)
  set newFilePath to ((path to desktop) as text) & "record-display"
  tell application "System Events"
    make new property list item with properties {kind:record, value:aRecord}
    make new property list file with properties {contents:the result, name:newFilePath}
  end tell
end writeRecordToPlist

Here it refuse to compile.

It stops on line :
make new property list item with properties {kind:record, value:aRecord}

The Events Log is :

tell current application
system info
--> {AppleScript version:"2.3.1", AppleScript Studio version:"1.5.3", system version:"10.9.2", short user name:"••••••••", long user name:"••••••••", user ID:501, user locale:"fr_FR", home directory:alias "Macintosh HD:Users:••••••:", boot volume:"Macintosh HD", computer name:"••••••••", host name:"••••••••", IPv4 address:"••••••••", primary Ethernet address:"••••••••", CPU type:"Intel 80486", CPU speed:2800, physical memory:12288}
path to desktop
--> alias "Macintosh HD:Users:••••••••:Desktop:"
end tell
tell application "System Events"
make new property list item with properties {kind:record, value:{AppleScript version:"2.3.1", AppleScript Studio version:"1.5.3", system version:"10.9.2", short user name:"••••••••", long user name:"••••••••", user ID:501, user locale:"fr_FR", home directory:alias "Macintosh HD:Users:••••••••:", boot volume:"Macintosh HD", computer name:"••••••••", host name:"••••••••", IPv4 address:"••••••••", primary Ethernet address:"••••••••", CPU type:"Intel 80486", CPU speed:2800, physical memory:12288}}
--> property list item "sans titre"
--> error "Record keys for property list items must be strings, not terminology." number -1703

Résultat :

error "Erreur dans System Events : Record keys for property list items must be strings, not terminology." number -1703 to item

Yvan KOENIG (VALLAURIS, France) mercredi 9 avril 2014 22:34:44



 _______________________________________________
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: names of a record's items
      • From: Alex Zavatone <email@hidden>
References: 
 >Re: names of a record's items (From: Luther Fuller <email@hidden>)
 >Re: names of a record's items (From: Alex Zavatone <email@hidden>)

  • Prev by Date: Re: names of a record's items
  • Next by Date: Re: names of a record's items
  • Previous by thread: Re: names of a record's items
  • Next by thread: Re: names of a record's items
  • Index(es):
    • Date
    • Thread