• 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
Writing to an existing file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Writing to an existing file


  • Subject: Writing to an existing file
  • From: Steve Roy <email@hidden>
  • Date: Fri, 12 Sep 2003 11:30:15 -0400

I'm puzzled. I can't write a script that opens an existing file for writing
anymore. I might be forgetting how to do it?

The script below works the first time you run it, but subsequent times generates
an error "Duplicate file name. Beauty:Users:steve:Desktop:Test.txt".

set theFilePath to (path to desktop as string) & "Test.txt"
set theFileRef to open for access theFilePath with write permission
write "Hello!" to theFileRef
close access theFileRef

Why won't it let me open the file?

Steve

--
Steve Roy <email@hidden>
Personal homepage: <http://homepage.mac.com/sroy>
Projects homepage: <http://www.roydesign.net>
_______________________________________________
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: AppleScript dictionary
  • Next by Date: Re: Writing to an existing file
  • Previous by thread: Re: AppleScript dictionary
  • Next by thread: Re: Writing to an existing file
  • Index(es):
    • Date
    • Thread