Community
    • Login

    Open container folder in cmd but as a toolbar button ?

    Scheduled Pinned Locked Moved General Discussion
    3 Posts 3 Posters 48 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.
    • S
      shodanx2
      last edited by

      Hello,

      I would like to have a toolbar button for this action

      06d83c36-520d-475e-afe2-71949e87b4ad-image.png

      Is it possible to have that ?

      thanks

      EkopalypseE 1 Reply Last reply Reply Quote 0
      • EkopalypseE
        Ekopalypse @shodanx2
        last edited by

        @shodanx2

        One way would be using the PythonScript plugin.
        Create a new script, give it a meaningful name and add something like this

        from Npp import notepad, MENUCOMMAND
        
        notepad.menuCommand(MENUCOMMAND.FILE_OPEN_CMD)
        

        Add it, via the Configuration... menu item to the toolbar section

        296b3ece-b601-4006-8d70-fcbd2b053ef6-grafik.png

        and restart npp.

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

          @shodanx2 ,

          Alternately, install the Customize Toolbar plugin, enable Plugins > Customize Toolbar > Custom Buttons, then edit ...\plugins\Config\CustomizeToolbar.btn to include something like the following:

          File,Open Containing Folder,cmd,,onion.bmp,onion.ico,onion.ico
          File,Open Containing Folder,Explorer,,*R:Ex,*G:Ex,*B:Ex
          

          The first line uses a pair of BMP (16x16, 256 color) and ICO files I had readily available to do the open-containing-folder-in-cmd, and the second line does the explorer version: it uses a RED-background Ex if using Standard Icons, a GREEN-background Ex if using Fluent icons in Light Mode, and a BLUE-background Ex if using Fluent icons in Dark Mode:

          d8b62c68-ba9c-4138-a0e8-6025055143fa-image.png
          a9742ca9-9ef4-4440-acd5-8ef82c33aa10-image.png
          d14c69f5-60ab-489f-8237-5546e6a8aeb3-image.png

          As mentioned here, the extra spaces around the buttons are due to an unfixed bug in the CustomizeToolbar plugin. The workaround is to also define a replacement icon for the Show Symbol default toolbar entry using

          View,Show Symbol,Show All Characters,,Icons\allChars.bmp,Icons\allChars_off.ico,Icons\allChars_off_dark.ico
          

          That issue-comment has links to where you can get the BMP and two ICO files for that button.
          But using that in addition to the commands I showed earlier will make the button toolbar more compact:
          edd28df4-f9e6-42b1-9bfd-979527514a54-image.png

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