Export txt files and images on ESC