Community
    • Login

    Opening Notepad++ in Post-It mode

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 3 Posters 1.5k 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.
    • Matej VitekM Offline
      Matej Vitek
      last edited by

      I’m trying to create a shortcut that will open a file in NP++ at specific coordinates, with the title bar, status bar, line numbers, etc. all hidden.

      Is there a way to make the Post-It mode (F12) persist between sessions (via config.xml) or, alternatively, open NP++ in Post-It mode via command line? I can see here there’s an -alwaysOnTop flag, but I don’t see one for Post-It mode.

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA Offline
        Alan Kilborn @Matej Vitek
        last edited by

        @Matej-Vitek

        I don’t think Notepad++ supports opening in Post-It mode directly, and as you’ve observed, that mode isn’t persistent between runs.

        You might have luck using a scripting plugin (e.g. PythonScript) and having a startup script that executes the Post-It command, e.g. notepad.menuCommand(MENUCOMMAND.VIEW_POSTIT).

        You may be able to do something similar with the NppExec plugin; I wouldn’t know the details on that.

        Michael VincentM 1 Reply Last reply Reply Quote 4
        • Michael VincentM Offline
          Michael Vincent @Alan Kilborn
          last edited by

          @Alan-Kilborn said in Opening Notepad++ in Post-It mode:

          You may be able to do something similar with the NppExec plugin; I wouldn’t know the details on that.

          @Matej-Vitek

          For NppExec, put the following in your startup script (Plugins => NppExec => Advanced Options… => “Execute this script when Notepad++ starts”):

          NPP_MENUCOMMAND "View\Post-It"
          

          Cheers.

          Matej VitekM 1 Reply Last reply Reply Quote 5
          • Matej VitekM Offline
            Matej Vitek @Michael Vincent
            last edited by

            @Michael-Vincent Thanks, I’ve managed to make this work with my use case. In case anyone’s interested, this is roughly what I’m doing (AHK code):

            fileOpen := false
            ^+b::
            if not fileOpen {
            	fileOpen := true
            	FileCopy, Backup\Notepad++\config (PostIt).xml, %A_AppData%\Notepad++\config.xml, 1
            	FileCopy, Backup\Notepad++\NppExec (PostIt).ini, %A_AppData%\Notepad++\plugins\config\NppExec.ini, 1
            	Run, "C:\Program Files\Notepad++\notepad++.exe" "C:\Path\To\PostIt\File.txt"
            } else {
            	fileOpen := false
            	FileCopy, Backup\Notepad++\config.xml, %A_AppData%\Notepad++\config.xml, 1
            	FileDelete, %A_AppData%\Notepad++\plugins\config\NppExec.ini
            }
            return
            

            The config (PostIt).xml is the file with my PostIt NP++ configuration (i.e., no title bars, line numbers, etc.) and config.xml is my usual NP++ configuration. The NppExec (PostIt).ini file is the configuration file for the NppExec plugin, which launches a script on startup that contains the following:

            NPP_CONSOLE 0
            NPP_MENUCOMMAND "View\Post-It"
            

            This now seems to work as I want it. Thank you both for the help.

            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