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

Re: Simple question.... writing to file


  • Subject: Re: Simple question.... writing to file
  • From: Bastiaan Boertien <email@hidden>
  • Date: Thu, 10 Feb 2005 13:31:47 +0100

Hi Bernado,

If you use open for access then this can maybe help you

set theFile to (path to desktop folder) & "myTextFile.txt" as string
set theData to "the contents of the text file"
open for access file theFile with write permission
set eof file theFile to 0 -- the file is empty now
write theData to file theFile
close access file theFile


greetings bastiaan
Op 10-feb-05 om 13:13 heeft Bernardo Hoehl het volgende geschreven:

Hi List,


I think this is a simple one. But I can't figure out how.

I have to write a diferent content to an existing text file, and right now, what happens is that when the new content is shorter than the previous content, the tail of the old text remains in the file.

How do I "empty" the content of a text file before writing the new content?

Thanks!

Bernardo Höhl
Rio de Janeiro - Brazil
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Simple question.... writing to file (From: Bernardo Hoehl <email@hidden>)

  • Prev by Date: Re: Simple question.... writing to file
  • Next by Date: Re: Simple question.... writing to file
  • Previous by thread: Re: Simple question.... writing to file
  • Next by thread: Re: Simple question.... writing to file
  • Index(es):
    • Date
    • Thread