Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: open for access file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: open for access file



>> Mine is a domestic setup, a destop plus a laptop, a wireless router, which I
suppose makes it a network.

No that doesn't explain it.

So far, I don't think anyone has been able to duplicate that specific error,
with this script, but that happens sometimes and we can go on without
letting it hang everything up.

Have a look at this, paste it into script editor and run it. (Be sure to
open the log first)

----------
set StoryFile to (path to users folder as string) & "ThreePigs.txt"
log StoryFile
--  MacOSX:Users:ThreePigs.txt

set InputFile to open for access StoryFile
log InputFile
--  276  (each run will produce a different number)

set EntireStory to read InputFile as string

close access InputFile
display dialog EntireStory
-----
set EntireStory to read StoryFile

display dialog EntireStory

_______________

Does it compile?

Does it run?

Does it display two dialogs with the correct information?

In the script you posted, the line

set InputFile to open for access file StoryFile


 wouldn't compile OMM, so I removed "file" and it worked.

In general, open for access command is not needed for simply reading an
entire file. You would use that if you're reading a file a point, doing
something else, then coming back to the file to read some more.

HTH,

ES


 _______________________________________________
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

References: 
 >Re: open for access file (From: Michelle Steiner <email@hidden>)



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.