Set line data associates data with a line. So if you had a list of names you could set an e-mail to go with each line which wasn't visible, for example. It won't change the item name.
As the copy as text is a bit dodgy, it'd help if for the second issue you uploaded a .cap file. But there is a FindLine expression; you don't need to do a for each loop and check the text.