• 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
Standard Additions 'read' command - basic questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Standard Additions 'read' command - basic questions


  • Subject: Standard Additions 'read' command - basic questions
  • From: Chap Harrison <email@hidden>
  • Date: Sun, 18 Jan 2004 23:35:24 -0600

Hi all,

First post to the list, first-time user of Applescript, but not a novice programmer.

I used a Unix script to create a text file that I need to read from an Applescript in order to add records to a Filemaker DB.

The text file consists of records, each of which contains a variable number of fields. So far so good, with one caveat: the "fields" are ASCII text which may contain Mac new-line characters (in fact, any ASCII character). Therefore, I chose to delimit these fields with the non-ASCII character 0xfe. Furthermore, since each record contains an unknown number of fields, I must also delimit each record -- I use 0xff.

The first thing I noticed was that a single invocation of 'read' appears to return the entire *file* as a list!! Is this how 'read' is supposed to work?

If so, are there any limits as to the length of a list?

The second problem was that 'read' doesn't care for my high-end delimiters:

set foo to (read fid using delimiter (ASCII character 254)) -- also tried 255

foo is a list containing one string, which is the contents of the entire file, with my oddball delimiters intact.

Are 0xfe or 0xff not valid delimiters as far as AS is concerned?

Suggestions for a better approach?

Thanks,
Chap
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Standard Additions 'read' command - basic questions
      • From: Michael Grant <email@hidden>
    • Re: Standard Additions 'read' command - basic questions
      • From: Axel Luttgens <email@hidden>
    • Re: Standard Additions 'read' command - basic questions
      • From: Christopher Stone <email@hidden>
    • Re: Standard Additions 'read' command - basic questions
      • From: Emmanuel <email@hidden>
    • Re: Standard Additions 'read' command - basic questions
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Re: how to get the text selection in an applescript
  • Next by Date: Re: Standard Additions 'read' command - basic questions
  • Previous by thread: Re: How to get remote location out of choose application
  • Next by thread: Re: Standard Additions 'read' command - basic questions
  • Index(es):
    • Date
    • Thread