• 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 with write permission
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Open for access with write permission


  • Subject: Re: Open for access with write permission
  • From: T&B <email@hidden>
  • Date: Fri, 23 Mar 2007 11:02:59 +1100

Hi Michelle,

set UserFile to choose file with prompt "Please choose the dictionary file to add the words to."

set fileRef to open for access UserFile with write permission

-->  "File file Dora:Users:michelle:Desktop:en is already open."

set eof of fileRef to (get eof of fileRef) + 1
write additions to fileRef
close access bar

Why are you opening into fileRef, but closing bar? They should be the same variable.


If I put a close access statement right before the open access statement, I get an error saying that the file isn't open.

How exactly are you using the close access command?

This should work:

set UserFile to choose file with prompt "Please choose the dictionary file to add the words to."
try
close access UserFile
end try
set fileRef to open for access UserFile with write permission
write additions to fileRef
close access fileRef


But this won't work:

set UserFile to choose file with prompt "Please choose the dictionary file to add the words to."
set fileRef to open for access UserFile with write permission
close access fileRef
write additions to fileRef
close access bar


And this:

set fileRef to open for access UserFile with write permission

I don't think is necessary. I thing "write" automatically starts at the next byte, not overwriting the last one.


Tom

_______________________________________________
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 with write permission
      • From: Michelle Steiner <email@hidden>
References: 
 >Open for access with write permission (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: do shell hanging
  • Next by Date: Re: Open for access with write permission
  • Previous by thread: Open for access with write permission
  • Next by thread: Re: Open for access with write permission
  • Index(es):
    • Date
    • Thread