Recording and making a script for editing photos.

I read up about and made a script yesterday to perform some editing on photos, however I can't get it save even tho' it is in the script.

Any ideas what I'm doing wrong?

I need it to increase the dpi (which it does) then save to a specific folder. It is performing the dpi increase when I check and I can close the files without it asking if I wish to save but when I check the folder there are no files saved, neither have the originals changed.