read file using delimiters suddenly returns just 2 chars

I must be going nuts. I went back to a script today that I hadn’t used in 4-5 days and found that it failed miserably. I finally traced it to the fact that it is supposed to read in a text file and parse each line of it using return as delimiter. That used to work fine. So it would return all the lines of a 400-500 line file. Now it just returns the first two letters of the first line of the file.

I thought that this might be due to some hidden characters though I have no idea where they might have come from. But using the unix command “od -c” showed nothing unusual. A line that begins “Absolute” returns just “Ab” for the entire text file. If I change it to “Access” it just returns “Ac”, the first two letters of the first line.

Currently I use the delimiters {return}. I also tried {“\n”}, which is what is actually in the text file being read, but got same results.

Does anyone have any idea what could have gone wrong? This script, which has worked for months of testing, is now a few days away from going live so there’s some urgency in fixing it.

Thanks,

Ken

I did a little more experimenting with this and tested the size of file when read from 1 to eof. The result: 0.0. So Applescript was saying that the beginning of the file was also the end of the file. I don’t have any idea why this would happen but rebooting solved the problem. I sure don’t like having to solve problems this way, but better solved than not solved.:frowning: