I would not use For Each Action just to get the nth line.
See:
MACRO: Get Item from List by Position [Example]
In the JXA script, there are options for getting the list from a KM Variable or from a file.
I would not use For Each Action just to get the nth line.
See:
In the JXA script, there are options for getting the list from a KM Variable or from a file.