• 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 to a file - overwriting contents
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing to a file - overwriting contents


  • Subject: Re: Writing to a file - overwriting contents
  • From: Paul Berkowitz <email@hidden>
  • Date: Sun, 02 Feb 2003 06:56:11 -0800

On 2/2/03 6:02 AM, "James Burns" <email@hidden> wrote:

>
> Thanks to everyone for their help on my previous question(s). I've got
> one more, probably a simple one...
>
> What's the proper routine for writing to a file to insure overwriting
> the contents? I've noticed that just using the write command seems to
> start at the beginning of the file and writes for the length of
> whatever you're writing. The problem is if your new length is shorter
> than the old length.
>
> Is there a common routine using the setoef command to properly
> overwrite files?

set s to "very short text"
set f to open for access alias filePath with write permission
set eof f to 0
write s to f
close access f

--
Paul Berkowitz
_______________________________________________
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.

References: 
 >Writing to a file - overwriting contents (From: James Burns <email@hidden>)

  • Prev by Date: iMovie scripting - What's going on? + Targeting a button with no title or name
  • Next by Date: Re: Simple Safari/IE Script question
  • Previous by thread: Writing to a file - overwriting contents
  • Next by thread: iMovie scripting - What's going on? + Targeting a button with no title or name
  • Index(es):
    • Date
    • Thread