Re: writing data to a file
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.