Close all Edit* files without prompting

Close all Edit* files without prompting

23
Basic UserBasic User
23

    Aug 23, 2010#1

    I'm trying to write a script that closes all files with the Edit* prefix that I'm using for junk and need to clear once and a while. I don't want to get save prompts when I run the script.

    Any ideas?

    6,604548
    Grand MasterGrand Master
    6,604548

      Aug 24, 2010#2

      That is very simple because new files never saved have no file name which means the file name is empty for such a "file" (better: edit buffer).

      Code: Select all

      // Close all new files without prompt.
      var nFileIndex = UltraEdit.document.length;
      while (nFileIndex--) {
         if (UltraEdit.document[nFileIndex].isName("")) {
            UltraEdit.closeFile(UltraEdit.document[nFileIndex].path,2);
         }
      }
      Best regards from an UC/UE/UES for Windows user from Austria