Here is the most simple version which would do what I think you try to achieve:
Button[ "Convert Picture", imgT = Import[SystemDialogInput["FileOpen", ".jpg"]]; data1 = ImageData[imgT]; {nRaw, nCol, nChan} = Dimensions[data1]; d = data1[[All, All, 2]]; d = d*(-1)^Table[i + j, {i, nRaw}, {j, nCol}]; fourieT = Fourier[d, FourierParameters -> {1, 1}]; abs = Log[1 + Abs[fourieT]]; Export[SystemDialogInput["FileSave", ".jpg"], Image[abs/Max[abs], ImageSize -> 1000]], Method -> "Queued" ]
Of course there are several things you might want to improve once you start using it. First of all it makes sense to create a function from the code and only call that code in the button. Next it is good practice to localize the variables you are using and to check whatever input comes back from the user. Finally I would separate the functionality of getting the filename from the pure algorithm which will make it much more convenient to make changes of the code and test these changes. The final result of such changes could look like this:
createSpectrum[imgT_Image] := Module[{data1, nRaw, nCol, nChan, d, fourieT, abs}, data1 = ImageData[imgT]; {nRaw, nCol, nChan} = Dimensions[data1]; d = data1[[All, All, 2]]; d = d*(-1)^Table[i + j, {i, nRaw}, {j, nCol}]; fourieT = Fourier[d, FourierParameters -> {1, 1}]; abs = Log[1 + Abs[fourieT]]; Image[abs/Max[abs], ImageSize -> 1000] ]; Button["Convert Picture", Module[{filein = SystemDialogInput["FileOpen", ".jpg"], fileout, spectrum}, If[StringQ[filein] && FileExistsQ[filein], spectrum = createSpectrum[Import[filein]]; fileout = SystemDialogInput["FileSave", ".jpg"]; If[StringQ[fileout], Export[fileout, spectrum]] ] ], Method -> "Queued" ]
Of course there are still many things to improve, like better error checking, a progress indication while the spectrum is calculated, some plan for how to deploy etc. Whether or not it is worth to invest such efforts depends of course on how the code is going to be used. You will find many answers on this site to help you with any of these details -- or just ask another question...
imgTcome from? For the rest, when usingMethod->"Queued"you basically just can copy the code into the second argument ofButton, or better make it a function and put the function call there instead... $\endgroup$SystemDialogInput["FileOpen"]to let the user choose the file to import, then import, process the data, ask user for the file to save and finally do the export. Is that what you plan to do? If so, you might edit the question to make it more clear what you are after... $\endgroup$