script opens and writes text to a text file in a folder