does it have to be one the image content or can it be on the border?
if so try Dr Russell Browns's scripts
hmmm... to me its a little tricky... but to do a custom automate, it would be something like calling from EXIF data, "imageFileName" then workout how and where to place it, baring in mind that you could have both landscape and portrait orientation....m hmm i would again look at www.russellbrown.com
I am pretty sure he has a Copyright panel, where you can also use imagefilename as text, but also lets you place it where ever you want....i am on CS6 beta atm and there is no current scripts available from Dr Brown atm... but for earlier versions (e.g. CS 5.x) there should be....
... the whole idea behind scrips and batch processing is not to re-invent the wheel every time we do something, so go use someone else's script and adapt it to your needs