• 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: How to use delimiters in Standard Additions file read/write commands?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to use delimiters in Standard Additions file read/write commands?


  • Subject: Re: How to use delimiters in Standard Additions file read/write commands?
  • From: Devon and Cornwall <email@hidden>
  • Date: Sun, 18 Mar 2001 09:37:53 -0800

At 10:40 AM +0000 3/18/01, Charles Arthur wrote:

>I'm interested in the file commands of the Standard Additions for reading
>(and doing fast TID-based search+replace).

>However my script
> ----
>set thefile to choose file
>open for access thefile
>set theend to get eof of thefile
>--display dialog (theend & " bytes") as string -- used in earlier debugging
>set thelist to read thefile using delimiter {" "}
>close access thefile
>----
>fails at the "set thelist to..." point with "parameter error".

If you just want the words of a file in a list you can use either of these:

set thefile to choose file
set filRef to open for access thefile
set thelist to read filRef using delimiter {" "}
close access filRef
thelist

or (a little faster)

set thefile to choose file
set filRef to open for access thefile
set thelist to words of (read filRef)
close access filRef
thelist

HTH
Devon and Cornwall


  • Follow-Ups:
    • Re: How to use delimiters in Standard Additions file read/write commands?
      • From: Devon and Cornwall <email@hidden>
    • Re: How to use delimiters in Standard Additions file read/write commands?
      • From: Charles Arthur <email@hidden>
References: 
 >How to use delimiters in Standard Additions file read/write commands? (From: Charles Arthur <email@hidden>)

  • Prev by Date: Re: Help; I did something stupid!
  • Next by Date: [META] Character mangling by this listserver and other factors (was Re: Startup items applet problem)
  • Previous by thread: How to use delimiters in Standard Additions file read/write commands?
  • Next by thread: Re: How to use delimiters in Standard Additions file read/write commands?
  • Index(es):
    • Date
    • Thread