Is it always the exact same fields?
If I understand you correctly, create a layout with just the fields you want to export. When the user clicks the button to perform the script, have it:
Change layout to the layout with the fields you want to export
Perform the export
Go back to the original layout
But the better way is in the export dialog, to just select the fields you want to export, and how you want them grouped
Export Records exports all the records in your current found set. So to export data from a select record or group of records requires producing a found set of just the records that you want to export. The Export Script step then has a dialog box for specifying what fields to include from that found set in your export. So if it is the same fields every time it's a fairly straight forward thing to set up.
PhilMod: My window already shows the found set to export; I just do not know the script to export only specific and select data fields from the active table. I created a script line:
Export Records [No Dialog]; "StoneDownload.xlsx"; Automatically open; Unicode (UTF-16)]
This worked initially quite well but now I cannot figure out how to add or delete previously defined data fields for export - it always exports my first version of data. (and to be honest, I can't figure out how I originally set up that spreadsheet months ago!)
I just figured it out after trial and error. Now I see in the Export Records script line to "Specify export order" button to make the changes (it had scrolled off the bottom of my screen).