This TML can be used to name line objects using the name of the objects layer. You just select the line to name and enter a name "mask".
You specify the new name using a name mask. If "{L}" is included in the new name, the layer name will replace that. Using "{N}" will insert previous name. So if you enter something like " L={L} old={N}" you will get something like "L=MyLayer old=OldName"
If you just want the name of the object to be the layers name, use "{L}" for name mask. (don't add quote characters)
By default, lines with an existing name will be skipped but you can "uncheck" the "Ignore lines with a name" option and all lines will have their name assigned.
An option to add a text label at the mid-point of the line has been added. The text will be the line's new name.