Re: read from file
Re: read from file
- Subject: Re: read from file
- From: John Delacour <email@hidden>
- Date: Mon, 5 Aug 2002 09:23:01 +0100
At 9:54 pm -0500 4/8/02, email@hidden wrote:
When I try:
Read from file "myFile" until return
everything is OK until the last paragraph of the file when there is no
return so consequently everything stops.
I understand that AppleScript's "read" doesn't require an "open for
access"; but I must not have the format correct
It does if you want to read it like this!
I not only need to be able to read a paragraph at a time but also
simultaneously to watch for EOF.
set f to "" & (path to current user folder) & "junk.txt"
try
close access file f
on error e
end try
open for access file f with write permission
set paras to {}
set eof file f to 0
write "one
two
three
" to file f
close access file f
open for access file f
repeat
try
set end of paras to read file f until return
on error eof_
close access file f
return (choose from list paras with empty selection allowed)
end try
end repeat
_______________________________________________
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.