Re: Strange Error Reading File
Re: Strange Error Reading File
- Subject: Re: Strange Error Reading File
- From: David Crowe <email@hidden>
- Date: Tue, 6 Apr 2004 09:24:51 -0600
Richard;
You seem to have identified the problem (you'd think I'd know by now,
but I guess I was lulled by the fact that this usually works).
"AFile" was passed to the function as a string. I've changed the
function call to pass it as the alias instead of casting it to string.
If that doesn't work I'll try using the keyword "file" in front of
the value as string.
(my gut instinct is that it's always better to remove words from a
program than add them!)
If someone can explain why "open for access X" sometimes works when
"X" is a string, and sometimes gives an error (a misleading error at
that), I would appreciate it!
- David Crowe
From: Richard Morton <email@hidden>
Subject: Re: Strange Error Reading File
Date: Tue, 6 Apr 2004 10:17:05 +1000
To: ASUsers List <email@hidden>
On 6 Apr 2004, at 12:51 AM, David Crowe wrote:
...I still don't understand the end of file error.
It's not a timing issue because if the file is bad I can read it a
second time and get the same error. And it's a mystery because if I
download it again it almost always works and a comparison shows that
the files are identical.
David Crowe wrote on Sat, 3 Apr 2004 11:47:39 -0700:
I am having strange errors reading small text files with Applescript.
The code in question is:
set ImportFileRef to open for access AFile
If 'AFile' is a path string:
"Mac HD:folder:file"
Then it will work the first time but fail subsequently. The 'open for
access' command requires a file spec, so perhaps that is the problem.
Try this:
set ImportFileRef to open for access file AFile
Cheers,
IO
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.