script opens and writes text to a text file in a folder, checks if the folder exists and if the file exists and if it doesn't it creates it.