• 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: open for access file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: open for access file


  • Subject: Re: open for access file
  • From: "Stockly, Ed" <email@hidden>
  • Date: Fri, 17 Jul 2009 16:15:23 -0700
  • Thread-topic: open for access file



>> You must open for access to write to a file however.
>
> Not really:


Cool.

This illustrates the difference.

ES

tell application "Finder"
    set someFile to (make file at desktop with properties
{name:"Mytest1.txt"}) as alias
end tell
open for access someFile with write permission
write "Here is some texta" to someFile
write "Here is some textb" to someFile
write "Here is some textc" to someFile
write "Here is some textd" to someFile
close access someFile

tell application "Finder"
    set someFile to (make file at desktop with properties
{name:"Mytest2.txt"}) as alias
end tell
write "Here is some texta" to someFile
write "Here is some textb" to someFile
write "Here is some textc" to someFile
write "Here is some textd" to someFile

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: open for access file
      • From: "Stockly, Ed" <email@hidden>
    • Re: open for access file
      • From: "Mark J. Reed" <email@hidden>
References: 
 >Re: open for access file (From: Shane Stanley <email@hidden>)

  • Prev by Date: How to detect if a file exists
  • Next by Date: Re: How to detect if a file exists
  • Previous by thread: Re: open for access file
  • Next by thread: Re: open for access file
  • Index(es):
    • Date
    • Thread