batch process - import, resize, export

Hi

I have a mega ton of images I need to process for my ecom site. I want to import the image to fill a 540x540px background and then export web optimized. I have tried to set up a script to batch process but the saved version has no image in it. Any ideas or is it best to run one process for resize then set up another script to web optimize them - or can it simply not be done?

Thanks in advance.