If you're scripting this, you could try setting up a related file with calculating fields which 'mirror' the content of the fields you want to let users export, then sending them to an export dialog from the related file instead. You'd need to set up the script to write the key fields to records in the related file first, so it would pick up the required field data from your main file.