• Login
Community
  • Login

Opening Notepad++ in Post-It mode

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
4 Posts 3 Posters 924 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.
  • M
    Matej Vitek
    last edited by Sep 21, 2022, 5:29 PM

    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.

    A 1 Reply Last reply Sep 21, 2022, 6:53 PM Reply Quote 0
    • A
      Alan Kilborn @Matej Vitek
      last edited by Sep 21, 2022, 6:53 PM

      @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.

      M 1 Reply Last reply Sep 21, 2022, 7:33 PM Reply Quote 4
      • M
        Michael Vincent @Alan Kilborn
        last edited by Sep 21, 2022, 7:33 PM

        @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.

        M 1 Reply Last reply Sep 22, 2022, 5:18 PM Reply Quote 5
        • M
          Matej Vitek @Michael Vincent
          last edited by Sep 22, 2022, 5:18 PM

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