Community
    • Login

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

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

        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