How to insert Path+Filename in an already opened doc



  • 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



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



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



  • 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



  • @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 ,


Log in to reply