How to read n-th line from the file?

The macro discussed here does read specific lines.

You can choose the JXA or the AppleScript solution.