Community
    • Login

    How to close ONE Tab from NP++ from cmdline/commandprompt?

    Scheduled Pinned Locked Moved General Discussion
    2 Posts 2 Posters 1.1k Views
    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.
    • Ben S.B
      Ben S.
      last edited by Ben S.

      Is there a way to close (from DOS batch file resp. from Command prompt) exactly one particular tab with e.g.the label/title/open file “aaaa.txt”?

      …how can I force NP++ to close it silently even if there is unsaved content in it (=then discard it automatically)?

      Is there a way to automatically close this tab from INSIDE NP++ after a certain time of inactivity (=no mouse movements)?

      1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones
        last edited by

        There isn’t a builtin way (ie, you cannot just re-run notepad++.exe with a command-line option to close a specific file). If you know of a way to send Windows API messages from the DOS batch file and/or command prompt, then you could possibly send a message to the appropriate component to close that file inside Notepad++. But any such way that I could imagine would require a fairly strong knowledge of the Windows API and messaging system, and probably knowing a programming language beyond batch file (probably via powershell script, and I’m quite sure through VBScript, Python, Perl, Lua, or any number of other full-featured programming languages).

        Purely inside vanilla Notepad++, there isn’t a way to set a auto-close-based-on-inactive-time. Using the PythonScript plugin (or LuaScript plugin), which combines the power of the Python (or Lua, respectively) programming language with direct access to the Notepad++ GUI and editor (scintilla) components, you might be able to create a script using callbacks (described in the PythonScript documentation), plus Python timer-based actions, to take care of that; but it’d be a complicated

        1 Reply Last reply Reply Quote 3
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors