extracted dir path and file name to variables
Now asking to save scratch when attempting to close an edited scratch