• 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: Read file using delimiter in 1.6
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Read file using delimiter in 1.6


  • Subject: Re: Read file using delimiter in 1.6
  • From: Christopher Nebel <email@hidden>
  • Date: Wed, 27 Feb 2002 11:54:43 -0800

On Wednesday, February 27, 2002, at 03:50 AM, Serge Belleudy-d'Espinose wrote:

I just read the AppleScript Sourcebook. It is said that 1.6 should have fixed most of 1.5.5 read/write problems, and that it allows 'as <class>' to be optional with 'using delimiter.'

Under 1.6 when I read a text file 'using delimiter return', everything is ok, but when I add 'as list' for backward compatibility I get a list of single item lists instead of a list of strings:

set vPath to "diamant:text"
set vFile to open for access vPath
set vData to read vFile as list using delimiter return
close access vFile
vData
-- {{"this"}, {"is"}, {"a"}, {"text"}, {"file"}}

Is it the way it is supposed to be, and is so what is the recommanded behaviour?
Is it safe to coerce the list of lists back to a list of strings if the first list item is a list?

You must have skipped the "new bugs" link -- this is a known bug unique to 1.6. The workaround is to say "as text" instead of "as list".

(and how much wood would a woodchuck chuck if a woodchuck could chuck wood? :)

A woodchuck would chuck as much wood as a woodchuck could chuck if a woodchuck could chuck wood.


--Chris Nebel
AppleScript Engineering
_______________________________________________
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.

References: 
 >Read file using delimiter in 1.6 (From: "Serge Belleudy-d'Espinose" <email@hidden>)

  • Prev by Date: Re: Running Script as root using Sudo
  • Next by Date: Unexpected negativity
  • Previous by thread: Read file using delimiter in 1.6
  • Next by thread: Beginners drop folder
  • Index(es):
    • Date
    • Thread