• 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: writing data to a file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: writing data to a file


  • Subject: Re: writing data to a file
  • From: Shane Stanley <email@hidden>
  • Date: Wed, 01 May 2002 09:04:21 +1000

On 1/5/02 2:02 AM +1000, Kinsella, John R., email@hidden, wrote:

> I have a script where I'm asking for data from the user via dialog boxes. I
> want to write that data to a file. And I want to keep writing the responses
> until the repeat loop is satisfied. My roadblock is that I can't seem to
> figure out how to access and write to a file more than once.

set theFile to choose file name
set fileRef to (open for access theFile with write permission)
set eof fileRef to 0
repeat
set theAns to (display dialog "Text please:" buttons {"Enough", "Go on"}
default answer "")
write text returned of theAns to fileRef
if button returned of theAns = "Enough" then
exit repeat
end if
end repeat
close access fileRef

--
Shane Stanley, email@hidden
_______________________________________________
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.

  • Prev by Date: Re: QXP-Find file open?
  • Next by Date: Re: addressing words between tabs in Xpress
  • Previous by thread: RE: QXP-Find file open?
  • Next by thread: Re: writing data to a file
  • Index(es):
    • Date
    • Thread