Community
    • Login

    Save Backup of Unnamed File - Work in Progress

    Scheduled Pinned Locked Moved General Discussion
    3 Posts 3 Posters 646 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • NN123616N Offline
      NN123616
      last edited by

      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?

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Terry RT Offline
        Terry R
        last edited by

        @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

        1 Reply Last reply Reply Quote 1
        • Alan KilbornA Offline
          Alan Kilborn @NN123616
          last edited by Alan Kilborn

          @NN123616

          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:

          3b364c94-49ff-400d-a05c-49f19d8e91f1-image.png

          This demo puts the file in the folder where the TEMP environment variable points, but that’s easily customized to something else.

          1 Reply Last reply Reply Quote 0

          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
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors