Re: file is already open & file wasn't open
Re: file is already open & file wasn't open
- Subject: Re: file is already open & file wasn't open
- From: Michelle Steiner <email@hidden>
- Date: Sat, 21 Apr 2007 13:17:49 -0700
On Apr 21, 2007, at 12:57 PM, deivy petrescu wrote:
Try this:
Script 1 log:
tell current application
open for access alias "Dora:Users:michelle:Desktop:TUntitled.txt"
244
write "Hello world" to alias
"Dora:Users:michelle:Desktop:TUntitled.txt"
display dialog "File not open with write permission.
-61"
{button returned:"OK"}
open for access alias "Dora:Users:michelle:Desktop:TUntitled.txt"
245
close access 244
write "Hello world" to alias
"Dora:Users:michelle:Desktop:TUntitled.txt"
display dialog "File not open with write permission.
-61"
{button returned:"OK"}
end tell
Script 2 gives me two results:
tell current application
close access alias "Dora:Users:michelle:Desktop:TUntitled.txt"
"File alias Dora:Users:michelle:Desktop:TUntitled.txt wasn't open."
or this:
tell current application
close access alias "Dora:Users:michelle:Desktop:TUntitled.txt"
open for access alias "Dora:Users:michelle:Desktop:TUntitled.txt"
with write permission
"File file Dora:Users:michelle:Desktop:TUntitled.txt is already open."
-- Michelle
--
I'm at an age where I can satisfy my wants without too many guilt
feelings.
_______________________________________________
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