Read file using delimiter in 1.6
Read file using delimiter in 1.6
- Subject: Read file using delimiter in 1.6
- From: "Serge Belleudy-d'Espinose" <email@hidden>
- Date: Wed, 27 Feb 2002 12:50:30 +0100
Hi all,
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? (and how much wood would a woodchuck
chuck if a woodchuck could chuck wood? :)
Thanks,
Serge
--
\\//\//\// Serge Belleudy-d'Espinose Institut Jacques Monod - Jussieu
// // //
http://www.ijm.jussieu.fr/ Universites Paris VI, VII - CNRS
//\//\//\\
_______________________________________________
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.