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 11:36:37 -0700
On Apr 21, 2007, at 11:18 AM, Emmanuel wrote:
I'm not able to write to a file via an applescript unless it was
opened with write permission.
"Just do it"
OK; it works with an existing file. You can't create a file and
write to it without creating it with write access without closing it
first.
This works:
set foo to choose file name
set bar to open for access foo
close access bar
try
write "Hello world" to foo
close access foo
end try
try
close access foo
end try
This doesn't:
set foo to choose file name
set bar to open for access foo
try
write "Hello world" to foo
close access foo
end try
try
close access foo
end try
-- Michelle
--
Reading computer manuals without the hardware is as frustrating as
reading sex manuals without the software.
-- Clarke's sixth law
_______________________________________________
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