• 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: Reading Lists and Records from Disk Files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading Lists and Records from Disk Files


  • Subject: Re: Reading Lists and Records from Disk Files
  • From: email@hidden
  • Date: Mon, 8 Jan 2001 16:46:04 -0500

I missed the original, but someone asked,

>I am trying to save applescript lists and records to and from disk files
>without much success. A single list such as {"One","Two",Three"} will come
>back as expected, but a list of lists such as {{"One", "Two", "Three"},
>{"Four", "Five", "Six"}} or a record such as {thename:"Popeye",
>thevice:"Spinach"}
>will generate an "Out of Memory Error" when reading it back.
>
>I am aware of the need to coerce the data to the appropriate class when
>getting it from disk i.e "as list" or "as record", but only text and single
>lists want to play ball. Any suggestions?

In my experience, this is a known bug. Complex lists and records don't get
written or read properly. There are two easy solutions:

1. Make the list or record a property of a script object, and save and load the
script object with "save script" and "load script"

2. Use Eric Grant's scripting addition "Sigma's Coercions". Its "Read/Write
Coercions" were meant specifically to translate these lists and records into
text that can be safely and reversibly written and read. "myComplexList as data
string" gives you a textual representation, and "textualVersion as original
class" gives you back the original data.
--
Scott Norton Phone: +1-703-299-1656
DTI Associates, Inc. Fax: +1-703-706-0476
2920 South Glebe Road Internet: email@hidden
Arlington, VA 22206-2768 or email@hidden


  • Follow-Ups:
    • Re: Reading Lists and Records from Disk Files
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Re: default buttons for dialog boxes
  • Next by Date: Re: Text String to Command??
  • Previous by thread: Re: Reading Lists and Records from Disk Files
  • Next by thread: Re: Reading Lists and Records from Disk Files
  • Index(es):
    • Date
    • Thread