I would like Photoshop to automatically execute the following task for a given folder:
look for the file SaveAsDifferentFileType.jsx on your computer, i think you could use this as starting point.
There is now way that i know of to generate this code automatically. I think there is no way around learning how it works:
Here the documentation: http://www.adobe.com/devnet/photoshop/scripting.html And here a tutorial that will tell you where to begin: http://morris-photographics.com/photoshop/tutorials/scripting1.html
If you are using a MAC you could try the Automator Photoshop actions: http://www.completedigitalphotography.com/?p=339
They will let you do what you want, without any programming know-how.