Hyperlink to a file? Win10
Is there a way to have a hyperlink to another file? Some searching would indicated the format:
…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.
PeterJones last edited by PeterJones
Use a full, correct file URL.
if I have the following in Notepad++,
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.
If you are going to write html sites, then I advise you to find out what a relative and absolute path is.
andrecool-68 last edited by andrecool-68
PeterJones last edited by
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.
@PeterJones What exactly the author of the question wants is not clear at all. I have no gift of foresight))
Alan Kilborn last edited by
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.
@Alan-Kilborn My crystal ball has low battery)))
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:
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:
Relative paths do not work for me. Neither of these work:
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.
Just for kicks, I tried this:
Which works most excellent.
PeterJones last edited by
Note: in Notepad++, you can select a path (whether relative or absolute, like
..\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.
@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).