Export Macro

I export a proof jpeg for my customer on near every file I open. My basic setting are

max width or height 11"
300 dpi
Apply ICC

My problem writing the macro is I can't get it to save it as the same name as the open file. It saves the file name that I recorded the macro with. I read up and do not see the correct code to pull the current file name to save it as. Any assistant will help.