Photoshop Iteration Loops, how?

Okay in photoshop I have a picture int he background and I have "#1" (text layer in foreground), save the pic as 1.jpg, next one I change to "#2" (text), save as 2.jpg, I could change it manually but I need "#10,000" for a game my friend is making.

Is there a way to do a for or while loop with the photoshop functions or with any plugins for photoshop? or any other way I can have it 1.jpg, 2.jpg, 3.jpg,etc...10000.jpg?