I hope it is because of text-frames threaded. If you draw 2 text frames without threaded and try the same coding what you wrote. It gave correct answer.
Please elaborate, as I am not clear about what you are trying to say.
I said, you must break the text frames thread and run the script. Each text frame not linked with another text frame. Just make a try and let me know
Can you post a screenshot so that we can see what things look like?
I guess that the frames are linked and that you have processed the texts and that throws the lines off to the old values.
What do you get if you replace "$.writeln(tfLK.lines.length)" with $.writeln(app.activeDocument.textFrames.itemByID(tfLK.id).lines.length) ?
I get an error in ESTK
I found my mistake. I had shortened the first text frame of the thread after looking for line number, so that is why I got the wrong results.
Thank you for trying to help