I haven't used that Toolbox, so I am kinda guessing here.
Do you get an error message from the ge_output() command? Since files(k).name is a string, I don't quite see why this doesn't work.
Does the output filename have to end in ".kml"? In that case, you could first do
to replace the ".txt" with ".kml".