Scirpt exporting history - how to overwrite existing files?

 

I found a script that exports history of multiple pairs, but when the Files folder already has the pairs (csv files) it won't do anything - is there any code or possibility to always overwrite them?

 
attach the source code as ex4 cannot be modified.
 
Keith Watford:
attach the source code as ex4 cannot be modified.

done

Reason: