Why do hookmark links sometimes fail?

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:

  1. 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.
  2. 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 for reporting this issue, @xiangshu .

I haven’t been able to reproduce the error so far.

Were the two tests conducted on the same file or different files?

For the first test, can you reproduce it? Could you please post the markdown link here?

Thank you

Thank you Bchend!!
I did the two tests on the same file, but now I can’t reproduce the previous test results. :smiling_face_with_tear:
However I conduct a new test and find new results. I will post the newest test process and results below.

    1. The original file name: “Why-do-hookmark-links-sometimes-fail?—Discussion-&-Help—Hookmark-Forum.pdf”
    • PDF link
      • from hookmark “copy link”
        • [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)
      • from “copy as markdown link”
        • [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)
    • PDF deep link
      • copy link
        • [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)
      • copy as markdown link
        • [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)
      • copy selection and link
        • 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)

    1. Change file name to “Why.pdf”
    • PDF link
      • from hookmark “copy link”
        • [Why.pdf] (hook://file/cRkHRLJPC?p=Q2xvdWRTdG9yYWdlL1N5bm9sb2d5RHJpdmUtUmVzaWxpb1N5bmM=&n=Why%2Epdf)
      • from “copy as markdown link”
        • [Why.pdf] (hook://file/cRkHRLJPC?p=Q2xvdWRTdG9yYWdlL1N5bm9sb2d5RHJpdmUtUmVzaWxpb1N5bmM=&n=Why%2Epdf)
    • PDF deep link
      • copy link
        • [Why.pdf] (hook://file/cRkHRLJPC?p=Q2xvdWRTdG9yYWdlL1N5bm9sb2d5RHJpdmUtUmVzaWxpb1N5bmM=&n=Why%2Epdf#p=1&x=0&y=0&s=252&e=289)
      • copy as markdown link
        • [Why.pdf] (hook://file/cRkHRLJPC?p=Q2xvdWRTdG9yYWdlL1N5bm9sb2d5RHJpdmUtUmVzaWxpb1N5bmM=&n=Why%2Epdf#p=1&x=0&y=0&s=252&e=289)
      • copy selection and link
        • 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)

    1. Change file name to “Whydolinksfail.pdf”
    • PDF link
      • from hookmark “copy link”
        • [Whydolinksfail.pdf] (hook://file/cRidnlafR?p=Q2xvdWRTdG9yYWdlL1N5bm9sb2d5RHJpdmUtUmVzaWxpb1N5bmM=&n=Whydolinksfail%2Epdf)
      • from “copy as markdown link”
        • [Whydolinksfail.pdf] (hook://file/cRidnlafR?p=Q2xvdWRTdG9yYWdlL1N5bm9sb2d5RHJpdmUtUmVzaWxpb1N5bmM=&n=Whydolinksfail%2Epdf)
    • PDF deep link
      • copy link
        • [Whydolinksfail.pdf] (hook://file/cRidnlafR?p=Q2xvdWRTdG9yYWdlL1N5bm9sb2d5RHJpdmUtUmVzaWxpb1N5bmM=&n=Whydolinksfail%2Epdf#p=1&x=0&y=0&s=252&e=289)
      • copy as markdown link
        • [Whydolinksfail.pdf] (hook://file/cRidnlafR?p=Q2xvdWRTdG9yYWdlL1N5bm9sb2d5RHJpdmUtUmVzaWxpb1N5bmM=&n=Whydolinksfail%2Epdf#p=1&x=0&y=0&s=252&e=289)
      • copy selection and link
        • 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)

  • Change file name to “faillinksofhookmark.pdf” and test results
    • The fourth rename does not generate any links.
    • Test opening the above links. Links generated from the following two files can be opened, but others cannot.
        1. “Why-do-hookmark-links-sometimes-fail?—Discussion-&-Help—Hookmark-Forum.pdf”
        1. “Whydolinksfail.pdf”

Here’s the PDF test file uploaded to OneDrive.

faillinksofhookmark.pdf

To make it easier for you to copy these links, I’ve added spaces between ] and (). Otherwise they will appear like below. Hope this can help you. :heart:

Why-do-hookmark-links-sometimes-fail?—Discussion-&-Help—Hookmark-Forum.pdf

Thank you for the detailed info, @xiangshu . That helps a lot!

I will try to reproduce the problem on my mac.

Thank you

It would be nice if it helped! :heart:
Can you reproduce this problem? Is there a solution to this?

Sorry @xiangshu , I don’t have luck yet. I just tested it again this morning.

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? :smiling_face_with_tear: :smiling_face_with_tear:

@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. :smiling_face_with_tear:
In addition, the software I use to synchronize my Mac and NAS is Synology’s official software: Synology Drive.

Hello, do you have any solution to this problem? Thank you so much!

Thank you for the info, @xiangshu . That’s very helpful.

We are still looking into this problem. Will keep you updated.

Thank you

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

That’s great! Thank you Bchend!

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. :smiling_face_with_tear: Hope Bchend and others can solve this problem.
@bchend Or is it possible to have Hookmark automatically “update” or “maintain” broken links?