Save Backup of Unnamed File - Work in Progress
-
Hi,
Windows Update keeps eating my files… it’d be amazing if autosave worked on files that weren’t named yet.
E.g. you start a new Notepad… start writing. and autosave grabs it for say unnamed1.txt
Is this possible?
-
@NN123616 said in Save Backup of Unnamed File - Work in Progress:
E.g. you start a new Notepad… start writing. and autosave grabs it for say unnamed1.txt
Is this possible?I suggest you start your reading here. This is a FAQ post that gives you lots of information about backup strategy and what Notepad++ offers, both built-in and with plugins.
If after that you still have questions ask away, but you need to read that first.
Terry
-
you start a new Notepad… start writing. and autosave grabs it for say unnamed1.txt
Is this possible?
I don’t know much about it, but maybe the AutoSave plugin will do that. I’ve never actually used that plugin.
I think the TakeNotes plugin can do such a thing, although it has been a while since I’ve used it.If I were doing it for myself, I’d use the PythonScript plugin and a little script, maybe like this:
# -*- coding: utf-8 -*- from Npp import * import os import time try: AUF__callback_npp_BUFFERACTIVATED except NameError: def AUF__callback_npp_BUFFERACTIVATED(args): if editor.getTextLength() == 0: if not os.path.isfile(notepad.getCurrentFilename()): notepad.saveAs(os.environ['TEMP'] + os.sep + time.strftime("%Y%m%d-%H%M%S", time.localtime()) + '.txt') notepad.callback(AUF__callback_npp_BUFFERACTIVATED, [NOTIFICATION.BUFFERACTIVATED])This will, instead of doing “unnamed1.txt”, do a timestamp for a filename; example:

This demo puts the file in the folder where the TEMP environment variable points, but that’s easily customized to something else.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login