• 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 from file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: read from file
      • From: Andy Wylie <email@hidden>
References: 
 >read from file (From: email@hidden)

  • Prev by Date: Re: How do I escape a question mark (?)
  • Next by Date: Re: Misc Eudora questions
  • Previous by thread: Re: read from file
  • Next by thread: Re: read from file
  • Index(es):
    • Date
    • Thread