add export to script function that produces a download link