Can you post a screenshot of the script?
When you create a file (by Export Records or Save Records As), there is an option:
Automatically open file
This can be unchecked so the file will NOT open. But you must set that up in the Script. Other screenshots may be helpful here as well. (JPG or PNG preferred, as they can be inserted "in line")
Retrieving data ...