• Login
Community
  • Login

How to insert Path+Filename in an already opened doc

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
5 Posts 4 Posters 584 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.
  • E
    Elodie CEMOI
    last edited by Oct 26, 2019, 3:26 PM

    Hi,
    I use Npp 7.7.1 and I would like to know how to insert the Path/Filename of the already opened document at (for ex) the beginning of the document ??
    Of course I will insert this after the “comment” marks “//”.
    This is for helping me to find the location of a document when opened in Npp.
    Thank you

    1 Reply Last reply Reply Quote 0
    • R
      rinku singh
      last edited by rinku singh Oct 26, 2019, 4:05 PM Oct 26, 2019, 4:04 PM

      @Elodie-CEMOI said in How to insert Path+Filename in an already opened doc:

      Path/Filename of the already opened document

      Use notepad++ demo plugin for current document

      1 Reply Last reply Reply Quote 0
      • A
        Alan Kilborn
        last edited by Oct 26, 2019, 7:12 PM

        Well, it is certainly very easy to right-click the tab of the document, choose the option to copy the complete pathname to the clipboard, and then do a paste at your desired location.

        I certainly wouldn’t bother with a plugin for that.

        1 Reply Last reply Reply Quote 1
        • G
          guy038
          last edited by guy038 Oct 26, 2019, 7:57 PM Oct 26, 2019, 7:57 PM

          Hello, @elodie-cemoi and All,

          Don’t you remember posting for the same question, about one year ago ?! Refer to Scott’s posts, below :

          https://community.notepad-plus-plus.org/post/34315


          Now, here is a macro, which needs to be inserted in the Macros node of your active shortcuts.xml file :

                  <Macro name="Insert Full Current File path" Ctrl="no" Alt="no" Shift="no" Key="0">
                      <Action type="2" message="0"    wParam="42057" lParam="0" sParam="" />    <!--  Insert Blank line Above Current      -->
                      <Action type="2" message="0"    wParam="42057" lParam="0" sParam="" />    <!--  Insert Blank line Above Current      -->
                      <Action type="2" message="0"    wParam="42057" lParam="0" sParam="" />    <!--  Insert Blank line Above Current      -->
                      <Action type="0" message="2300" wParam="0"     lParam="0" sParam="" />    <!--  Down Arrow key                       -->
                      <Action type="2" message="0"    wParam="42029" lParam="0" sParam="" />    <!--  Current Full File path to Clipboard  -->
                      <Action type="0" message="2179" wParam="0"     lParam="0" sParam="" />    <!--  Paste                                -->
                      <Action type="0" message="2300" wParam="0"     lParam="0" sParam="" />    <!--  Down Arrow key                       -->
                  </Macro>
          

          Wherever is your cursor, in current line, this macro writes the full path of your current file, between two pure blank lines, right above the present current line !

          Best Regards,

          guy038

          E 1 Reply Last reply Oct 26, 2019, 8:58 PM Reply Quote 2
          • E
            Elodie CEMOI @guy038
            last edited by Oct 26, 2019, 8:58 PM

            @guy038

            Sorry, sorry,… I apologize !
            I had stopped to use N++ about a year ago because of other priorities , and I just restart…
            Thank you very much ,

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