Possible to do a Batch Process Using "Export For Web"?

I am processing JPEG files, using a recorded script. It re-samples the images to the dimensions I want, and saves the image files. When I use the "Export for Web" function, to complete this task I find that the images are much smaller. Can the "Export For Web" be used in a batch process? If not, is there something I can add to my existing script to reduce the files size of the JPEGs?