Using graphical programs is NEVER a good way to automate procedures.
Fortunately for you, there is a GREAT program that can do EXACTLY what you are suggesting.
ImageMagick -- convert.
You might try a script along the lines of;
convert inputfile.jpg -fill white -stroke black -font Fontname -pointsize 20 -gravity center -annotate 0 "$1" "$2"
This will take the image "inputfile.jpg", write in "Fontname" typeface with size 20 in the center of the image. It will write $1 (value of first command-line argument) text in white with a black border, and create a new file "$2" (second command-line argument).
ImageMagick will look for MS TTF fonts in the path /usr/share/fonts/default/TrueType/Fontname.ttf, so make sure that you have fonts there.
More information here: http://www.imagemagick.org/Usage/text/