using script for multiple files

I have 592 files I need to open, 'explode', and save which I am trying to do with a script.  I can get it to open, explode, save and close the first file but it stops there.  It will not move onto the next file(s).  Sample below with generic "filename" replacing actual filenames.  Am I missing something?

 

open "filename1"

explode

all

qsave

close

open "filename2"

explode

all

qsave

close

repeat 590 more times :)