Lets say you had a layer that was named Sample Clip.mov, and you renamed that layer BOO. Now you add an empty text layer and then reveal the Source text property of the text layer. You would enable an expression for Source Text by dragging the pickwhip to your Sample Clip.mov layer and then add .name
The final expression would look like this:
If you renamed the layer to BOO the text layer would read. BOO, if you did not rename the layer then the text would read Sample Clip.mov.
Simple as that.
If you wanted the text layer to show the name of the layer just below it you would change the expression to read:
Then the text layer would always shot the source name or if you renamed the layer, the new name of the layer that was just below the text layer.
Sorry, there was a case error in my post, but here's a bit more detail for simplest way
Twirl down 'Text' attributes
Alt+click on stopwatch next to 'source text'
Type 'thisLayer.name' in the expression box
(use 'thisComp.name' for the comp name, or drag pick whip to a layer name & append '.name')
Trickier to use it for multiple lines though... then you might want to start reading stuff ike... http://www.provideocoalition.com/expression_shorts_-_read_external_text_document/
Thanks to you both. Got a much better understanding of how this works now