Today, I conducted some tests on hookmarks in order to understand whether Skim’s deep link can continue to be effective even when the PDF file is changed location or renamed.
Finally I got the following result:
Change the PDF file location, and the original hooked files/content will still be valid. And the “link” obtained through “copy link”, “copy markdown link”, and “copy selection and link” are still valid.
When renaming the PDF file, a confusing result appeared for me. I conducted two renaming tests. In both tests, the originally hooked files/content were still valid. This is the result I expected.
But for the three types of “links” (“copy link”, “copy markdown link”, “copy selection and link”), the two tests showed different results:
(1) The result of the first test was that after the PDF was renamed, the three The “links” obtained through these methods are all invalid, and the source PDF file cannot be found when clicking on these “links” (could not find file “xxx” in the Finder).
(2) The result of the second test is that after renaming the PDF, the three “links” are still valid. No matter what name I change the PDF to, I can open the source PDF file by clicking “links”.
So I would like to ask, under what circumstances will the hookmark link become invalid? What should I pay attention to when moving or renaming files?
Thank you Bchend!!
I did the two tests on the same file, but now I can’t reproduce the previous test results.
However I conduct a new test and find new results. I will post the newest test process and results below.
Why do hookmark links sometimes fail?
[Why-do-hookmark-links-sometimes-fail?—Discussion-&-Help—Hookmark-Forum.pdf] (hook://file/cRidnlafR?p=Q2xvdWRTdG9yYWdlL1N5bm9sb2d5RHJpdmUtUmVzaWxpb1N5bmM=&n=Why%2Ddo%2Dhookmark%2Dlinks%2Dsometimes%2Dfail%3F%2D%2D%2DDiscussion%2D%26%2DHelp%2D%2D%2DHookmark%2DForum%2Epdf#p=1&x=0&y=0&s=252&e=288)
Why do hookmark links sometimes fail?
[Why.pdf] (hook://file/cRkHRLJPC?p=Q2xvdWRTdG9yYWdlL1N5bm9sb2d5RHJpdmUtUmVzaWxpb1N5bmM=&n=Why%2Epdf#p=1&x=0&y=0&s=252&e=289)
Why do hookmark links sometimes fail?
[Whydolinksfail.pdf] (hook://file/cRidnlafR?p=Q2xvdWRTdG9yYWdlL1N5bm9sb2d5RHJpdmUtUmVzaWxpb1N5bmM=&n=Whydolinksfail%2Epdf#p=1&x=0&y=0&s=252&e=289)
In other words, you can open all links generated by renaming files, right?
If this is the case, then my test results are abnormal, so how should I solve this problem?
@xiangshu, is the file on some cloud storage? If it is, could you please tell us what the software it is? With some of the cloud storage softwares, when you rename a file, the file is actually recreated and replaced. In this case, the link could be broken temporarily. When this happens, if you restart Hookmark, the link could recover. I suspect this is the case.
Yes! The file I used for testing was stored on my NAS (my NAS brand is Synology). Because all the files I usually work on need to be stored on the NAS, I conducted this test.
However, I restarted Hookmark and still got the same result. Some links cannot open the original file.
In addition, the software I use to synchronize my Mac and NAS is Synology’s official software: Synology Drive.
For a broken link like this, there is no way to make it back to work unless you rename the file again to the same name that the link refers. To avoid this from happening, please give the cloud storage a moment (depending on the software could range from a few seconds to minutes) after you rename the file before you “copy link”.
Thank you so much for the information and help! Unfortunately, I ran a new test again and gave the NAS a few minutes to react after renaming, but still got the same result as above. Hope Bchend and others can solve this problem. @bchend Or is it possible to have Hookmark automatically “update” or “maintain” broken links?