Thanks a lot. I used
which achieved the desired result.
In case I have more problems with this script I will let you know.
Thanks again for the quick replies and the solution!
I have made the tool more generic. You can control the scope of the tool, Project, current folder and subfolders or current folder only. You can also choose to prepend, append or apply the text to the image's comment field. Not sure if anyone else would find it useful, but that doesn't matter.
If you do use this version you will need to deleted the tools preference file (for projects it has already been used on). It is in the project's root folder under the hidden .jalbum folder and is called defaultTextToCommentsSettings.properties