Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Writing without opening (was: Login Applescript won't write to file)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Writing without opening (was: Login Applescript won't write to file)



Deivy Petrescu's message of 30/6/01 2:42 AM contained:

>>The file is not opened for access anywhere in what you posted and opening
>>for access with write permission is required in this case.
>
>I am replying because of this line. No, it does not!

Deivy,

OK, it does work when run from Script Editor & I'll take your word for it
on the OSA Menu. This is all & well, but Mr Wilkinson is not having
trouble running it in either of these 2 ways.

From the Standard Additions dictionary:

write: Write data to a file that was opened for access with write
permission

The 'read' command can also work without an explicit 'open for access'
and these behaviours are neither documented (as far as I can see) nor
particularly reliable. I used to use 'read' without an explicit open & I
found that it would sometimes fail, so I stopped using it like that.

Nigel Garvey has, I believe, looked at the situations in which 'read'
tends to fail; Shane Stanley has noted that he also uses the official
method due to intermittent failures, if I recall correctly.

Given that intermittent failure is what's happening in the script under
discussion, I'm suggesting that using the command in the documented way
might be a good place to start trying to work out what's wrong with it.
Rather than assume it is working, let's try to prove it & see if we can
actually get the script working for him.

Cheers,

Richard Morton
-- Great Lies of the Music Business: "Your timing is great"




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.