• Login
Community
  • Login

Hyperlink to a file? Win10

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
11 Posts 4 Posters 9.6k 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.
  • G
    GarySe7en
    last edited by Oct 30, 2020, 3:54 PM

    Is there a way to have a hyperlink to another file? Some searching would indicated the format:

    file://[filename]
    

    or

    file:////[filename]
    

    or

    file:///[filename]
    

    …should do the trick. NPP highlights the line, like it does with all other hyperlinks, but clicking on it does nothing–no error message, no random app opening. Just nothing.

    Any recommendations?

    Thanks.

    P 1 Reply Last reply Oct 30, 2020, 4:09 PM Reply Quote 1
    • P
      PeterJones @GarySe7en
      last edited by PeterJones Oct 30, 2020, 4:10 PM Oct 30, 2020, 4:09 PM

      @GarySe7en ,

      Use a full, correct file URL.
      if I have the following in Notepad++,

      file:///C:/Users/peter.jones/Downloads/TempData/nppCommunity/post19638.html
      

      and I double-click that, it opens that local file in my default browser.

      If you are unsure of the full, correct file URL for a given file, browse to that file in Windows Explorer normally, drag into your browser (which should open the local file), then copy from the URL bar and paste into Notepad++. Close the browser tab with that file, so that you’ll know if the next step works. Double-clicking on that URL should now work – it does for me.

      If it doesn’t, you’ll have to provide more information. A screenshot showing the file correctly in browser; your Notepad++ ? menu’s Debug Info contents, maybe a screenshot of a new Notepad++ window with just the same URL as your browser screenshot shows, and anything else you think might help us help you.

      1 Reply Last reply Reply Quote 1
      • A
        andrecool-68
        last edited by Oct 30, 2020, 4:20 PM

        If you are going to write html sites, then I advise you to find out what a relative and absolute path is.
        https://www.google.com/search?q=Relative+and+absolute+path

        1 Reply Last reply Reply Quote 0
        • A
          andrecool-68
          last edited by andrecool-68 Oct 30, 2020, 4:30 PM Oct 30, 2020, 4:30 PM

          Example:

          css-html.png

          P 1 Reply Last reply Oct 30, 2020, 4:59 PM Reply Quote 0
          • P
            PeterJones @andrecool-68
            last edited by Oct 30, 2020, 4:59 PM

            @andrecool-68 ,

            Relative links work fine in HTML in a browser.

            The question was about the file:// URL protocol, and how Notepad++ handles that for double-clicking links in Notepad++ – not in a browser.

            This SO Answer gives more about what variants are and are not allowed in the file:// URL protocol, and links to the wikipedia page with even more info.

            A 1 Reply Last reply Oct 30, 2020, 5:16 PM Reply Quote 1
            • A
              andrecool-68 @PeterJones
              last edited by Oct 30, 2020, 5:16 PM

              @PeterJones What exactly the author of the question wants is not clear at all. I have no gift of foresight))

              A 1 Reply Last reply Oct 30, 2020, 5:22 PM Reply Quote 0
              • A
                Alan Kilborn @andrecool-68
                last edited by Oct 30, 2020, 5:22 PM

                @andrecool-68

                I would infer, from the original posting, that what is expected is that following the link would open the file in Notepad++, but that’s just a guess.

                A 1 Reply Last reply Oct 30, 2020, 5:31 PM Reply Quote 2
                • A
                  andrecool-68 @Alan Kilborn
                  last edited by Oct 30, 2020, 5:31 PM

                  @Alan-Kilborn My crystal ball has low battery)))

                  1 Reply Last reply Reply Quote 1
                  • G
                    GarySe7en
                    last edited by Oct 30, 2020, 6:50 PM

                    Thanks for the responses. Sorry if it wasn’t clear.

                    What I am looking for is the ability to, from a hyperlink in one text file, open another text file in NPP. For example, filename1.txt is a text note with link:

                    file://filename2.txt
                    

                    Clicking on that opens filename2.txt in NPP. That is what I am looking for.

                    It would appear I need the fully qualified path. This works:

                    file:///C:/Users/[removed]/notebook/2020-08%20journal%20daily%20summary.txt
                    

                    Relative paths do not work for me. Neither of these work:

                    file:///2020-08%20journal%20daily%20summary.txt
                    file:///./2020-08%20journal%20daily%20summary.txt
                    

                    Either way, thanks for the suggestions. This was enough to get it to work for me, even though how it works doesn’t meet my needs–but that isn’t NPP problem, that a user case problem.

                    Thanks again.

                    Just for kicks, I tried this:

                    mailto://some_random@email_address.com
                    

                    Which works most excellent.

                    P 1 Reply Last reply Oct 30, 2020, 7:20 PM Reply Quote 0
                    • P
                      PeterJones @GarySe7en
                      last edited by Oct 30, 2020, 7:20 PM

                      @GarySe7en,

                      Note: in Notepad++, you can select a path (whether relative or absolute, like c:\blah\file.txt or ..\blah\file2.txt, and right click and select Open File (equivalent to Edit > On Selection > Open File)… and Notepad++ will even allow c:/blah/file.txt, so if you select just the relative portion of the file:// URL, then you can open that file in Notepad++ quite easily.

                      G 1 Reply Last reply Oct 30, 2020, 7:39 PM Reply Quote 1
                      • G
                        GarySe7en @PeterJones
                        last edited by Oct 30, 2020, 7:39 PM

                        @PeterJones said in Hyperlink to a file? Win10:

                        you can select a path (whether relative or absolute, like c:\blah\file.txt or …\blah\file2.txt, and right click and select Open File

                        Wow! This is great. Obviously, I’ve never noticed that before. But this certainly makes the ability to link notes significantly easier.

                        I’ve given up on most note taking applications. Evernote, OneNote, even tried Joplin. But nothing has replaced a bunch of old fashioned text files, many of them now in markdown format, and replicated using NextCloud.

                        NextCloud has a decent markdown editor for mobile. All workstations need nothing more than NPP (which is on all of my systems).

                        Thanks again!

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