I would like Photoshop to automatically execute the following task for a given folder:
I realize this is an old question, but what the original post is asking for can be done entirely in a Photoshop Action. Photoshop actions are easy to record - you just hit record and do the steps manually. - including the Open, operations and save step.
The only trick left is to make the action run in a specific folder rather than the place you record the action. That's easy, however. Use the "Override Open" and "Override Save" options. You invoke this action using File -> Automate -> Batch or from Adobe Bridge using Tools -> Photoshop -> Action
See this for an example:
For some additional tips look here