Question regarding sharing hook-generated links with other users

Hi,

I have a question on an issue I have with Hook, which in all honesty may stem from my misunderstanding how hook is supposed to work, but nonetheless:

There are two separate user accounts (myself and my wife) on our computer, both using Hook which syncs to our respective iCloud accounts, and an external drive containing our shared files (fully accessible to both users).

Yesterday my wife, logged in using her own user account, was writing a markdown document, intending to be shareable between the both of us, including Hook-generated markdown links to files on the external drive. Previewing these files in Marked and using the latter to export them as both HTML and PDF, allows my wife to click the links and the corresponding files will then open.

However, when I open the same markdown file in Marked while being logged in my own user account, none of the links seem to work and neither do they when I try to export the markdown document to HTML or PDF. Clicking a link results in basically nothing happening.

Is this normal expected behaviour? I was under the impression that a hook file link generated by one person would allow any other person to open the file by clicking the link, as long as the linked file was accessible to the latter person. Or am I completely misunderstanding how these links are supposed to work?

Thanks for asking, @Timolution . Is it possible the target files (to which the file links point) were renamed before you got a chance to use the links to them in your account? The PDF and HTML exports should not make a difference they would have the same hook://file/ URLs.

@LucB No, nothing has changed about the files themselves (neither name nor location). If my wife logs in to her account the links work perfectly well, but opening the file while logged into my user account leads to nothing happening when clicking the links (apart from Safari or Firefox asking wether the link may open Hook, but after that nothing). Vice versa, links in documents I made in my account do not work when my wife tries to click them.

I also tried using my separate troubleshooting account to make a document with links, and then neither my normal user account nor my wife’s can open these links. Hook also has full disk access and accessibility rights on all accounts.

Is this because we are not using a shared folder to sync links (both of us sync our links to our respective iCloud accounts)? I understood that shouldn’t be necessary as long as the file name and location remains the same, but perhaps I am mistaken?

It does not sound like an issue with shared hook://file/URLs then.

no, that should not be an issue at all.

That’s correct. And for shared hook://file/ Hook can learn.

But let’s get to the sharing part after we sort out what is happening with your account.

in a simple test, Safari or Firefox should not be involved. I.e., a simpler test would be whether those URLs work in their raw form in the markdown file. If that works, which it should, then the (or at least an) issue might be that whatever process is generating the web page or PDF is causing an issue.

could you start by taking a raw hook://file/ URL from the markdown and feed it into Spotlight or LaunchBar, or another app that can resolve app URLs (like BBEdit where you can control click ). Or use textedit to turn it into a link (via ⌘K) or something.

alternatively, Hook has a Focus on Link in Clipboard command you can use after you copy the hook://file/ URL into the clipboard. From there (in Hook) you can do Title Menu > open ( ⌘O).

Mmmm, copying the raw link as you suggested does not help. Pasting it into Spotlight or Alfred does nothing; neither a file is shown nor does anything happen when pressing enter. Likewise, invoking hook, doing the focus on link in clipboard action and then choosing ‘Open’ leads to nothing happening… And this both in mine and my wife’s account when we try to invoke links made in one another’s user accounts.

I have also tried to do the same in my troubleshooter account, but with the same result. Also quickly trying again to make a simple test file in said account with a link also leads to both me and my wife’s accounts not being able to open said link.

My troubleshooting user account has no background processes running save for the standard builtin ones, Little Snitch (but for which the network filter is disabled), BackBlaze, Tuxera NTFS and BackupLoupe. So I doubt it would be due to another 3rd party app or service interfering… It is also an admin account, Hook has full accessibility rights and full disk access, and all users have read-write permissions on the external drive as well as on the files contained therein.

So I’m a bit stuck in trying to figure out what could be the underlying issue. Seems to me it should almost be something low-level in the OS itself, but drawing a blank on what this could be…

Could it be that this has something to do with the files residing on an external drive, despite every user having full access, I wonder? When I get home later today perhaps I should try to make some docs in the three user accounts with links to files on the internal main drive?

One (unlikely but technically possible) explanation would be if the Hook app itself is on a volume or in a folder to which only your wife’s account has access. If Hook.app is on a removable medium, macOS would normally try to mount it if it knows about it, which it tracks at sys level (which is a source of different problems).

I.e., it looks like Hook is not even known to your account. You could also try creating a .hook file in a text editor and place any URL in there, such as https://apple.com. Then double click on the file. If Hook is not launched then your account has no access to Hook.

Creating such a file is analogous to using Make Hook File – Hook

Hi Luc,

Hook is installed in the regular system level Applications folder. I can invoke hook no problem from my main account, from my troubleshooting one and from my wife’s one. Just to make sure I double checked by making a weblink containing Hook file as you proposed, and that works without issue on all three accounts.

I also tried to make a test file in my wife’s account that had a Hook link to a random application in the system level Applications folder (to make sure it would be something that would be definitely available for every user) and also a regular web link. I saved that text file in the shared user folder of the main HDD (to eliminate the external drive factor). After that both these links work on her account when I use the focus on link method you suggested above, but when I try the same in mine or the troubleshooting account, the Hook file link does not work whereas the simple weblink does.

So I do not think it is a problem of Hook not being known to our respective accounts, but just that hook links to files generated in one user account are not usable in another one for some reason, irrespective of where the targets of the links reside…

I made a movie showing you what happens when I invoke a link to a movie using the focus on clipboard link method, just to show what I see over here. This movie shows the markdown file my wife made, containing a markdown Hook file link to a movie (which is definitely accessible to both of us). When using the focus on clipboard link method, when logged in to my wife’s account, you can see that Hook ‘sees’ the movie and that it can be opened from the Hook window. Next you see the exact same file open while logged into my account, using the same method to focus on the exact same Hook file link, but now Hook does not see the movie file and nothing opens when choosing the ‘Open’ command.

You can find the MP4 (about 17 Megs) at this link: Hook issue example movie

(Apologies for the awful editing of the movie, but made it in a hurry :sweat_smile:)

thanks for this. Can you please try Console.app, search for Hook, click on those links, and if there is any error message? if so please copy the console output and send to us as a message to support. I’ve asked others here to have a look too. (If it’s a big file, best to compress and email support@cogsciapps.com please).

Sorry for my late reaction, but we went to bed early yesterday. Apologies.

I tried do as you told, but I don’t see any error messages appearing. Nonetheless, I’ve captured the console messages and associated activities, filtered with the search term ‘hook’, that appeared around the time I used both a Hook file link in the html rendered version of the md file, as well as when using the focus on clipboard link method. So I’ll send these off to the support team together with a link to this forum topic. :slight_smile:

Hello again with some more observations, which may perhaps not be important, but still… I was playing around with the raw Hook file links to see if those held any clue and I noticed the following:

  1. This is a link to file A as generated by user 1 today after restart:
    hook://file/3TVAbew42?p=VGltL1VuaWZpZWQgSG9zdHM=&n=Custom%20Restricted%20host%20file%20contents

  2. This is a link to file A as generated by user 2 today after restart:
    hook://file/3TSLz1sG6?p=VGltL1VuaWZpZWQgSG9zdHM=&n=Custom%20Restricted%20host%20file%20contents

  3. This a linkt to file B as generated by user 1 today after restart:
    hook://file/3KpVyDdJn?p=RGVlbCAxIC0gQmlvZGl2ZXJzaXRlaXQgZW4ga2xpbWFhdC9WaWRlb3M=&n=Biodiversiteit%20&%20klimaat-%20Biodiversiteit%20en%20klimaat%20-%20%20-%202021-09-15%2021-26-44.mp4

  4. This a linkt to file B as generated by user 1 today prior to restart:
    hook://file/3KpVyDdJn?p=U3BvZWRjdXJzdXMgQmlvZGl2ZXJzaXRlaXQgJiBrbGltYWF0L0RlZWwgMSAtIEJpb2RpdmVyc2l0ZWl0IGVuIGtsaW1hYXQ=&n=Biodiversiteit%20&%20klimaat-%20Biodiversiteit%20en%20klimaat%20-%20%20-%202021-09-15%2021-26-44.mp4

  5. This a linkt to file B as generated by user 2 today after restart:
    hook://file/3TOq0WD2N?p=RGVlbCAxIC0gQmlvZGl2ZXJzaXRlaXQgZW4ga2xpbWFhdC9WaWRlb3M=&n=Biodiversiteit%20&%20klimaat-%20Biodiversiteit%20en%20klimaat%20-%20%20-%202021-09-15%2021-26-44.mp4

Comparing those I noticed that the only difference between the links 1, 2, 3 and 5, being links generated after a restart by the different users, was the part between file/ and ?p=.

While logged into user 1’s account I noticed the following:

  • Transplanting said part from link 1 into links 3 or 4 and then doing focus on link using the latter actually makes Hook reveal the target of the former instead of that of link 3 or 4. In fact, it even seems that the part between ?p= and =&n= is entirely redundant, as just randomly changing characters in there still allows hook to find the file ‘associated’ with the part between file/ and ?p=.

  • In fact looking at links 1, 3 and 4 it seems that part is specifically user and file bound, as it remains constant between links 3 and 4 (which are links to the same file made after and before a restart of the computer), while there are large differences of the ?p= and =&n= part, whereas it is different for link 1 which points towards a different file.

  • Transplanting the part between file/ and ?p= from link 2 (user 2) to link 1 (user 1) breaks the ability of Hook to locate the file. Likewise, transplanting said part from link 5 to links 3 and 4 also breaks the ability of Hook to locate the targets of the latter two links.

  • Transplanting the part between file/ and ?p= from for example link 1 (user 1) into link 5 (user 2) results in Hook focussing on the file linked in link 1 when using focus on clipboard using the altered link 5.

Probably all of this is well-known behaviour, but it seems to me that whatever is causing this issue of not allowing different users on the same system to open each other’s file links is related to the part between file/ and ?p= of the links themselves…

Sorry I should have zeroed in immediately on this. Is Spotlight indexing enabled for you on that drive? You can test by trying to use Spotlight to find that file from your account. If not, please enable it and try again. It’s a fallback for shared links in different accounts than one in which link was created by user. that way Hook does not need to do the indexing (same principle as HoudahSpot).

Thank you for the suggestion, but given that the issue also occurs with links to files on the main HDD (ex. applications in the root Application folder), I would have been surprised if it was Spotlight related… But just to be sure I tried looking for the files on the external drive using spotlight search and Houdahspot, and both see the files just fine. And to be absolutely sure, I also forced a reindex of the drive using the mdutil tool through the CLI, but to no avail; Hook still refuses to resolve the links made by another user.

I also checked to make sure that our regional settings are the same, just to make sure it isn’t some weird . versus , usage problem or anything, but everything is the same between the accounts.

Please try quitting Hook from your spouse’s account before using the links in yours. Only one instance of Hook can run at the same time currently (that limitation will be removed in future).

Yes, actually all the tests I did until now were done with only one user logged in. So at no point were two users logged in at the same time. Sorry for not mentioning this earlier.

I also installed the Hook 3.3 beta release, but unfortunately no dice…

Just an update for anybody who would still be reading/watching this thread. After some back and forth testing with Luc and support though email, they were able to identify and fix whatever was causing this issue. As I understood these fixes will be rolled into the public version later on.

But thanks to Luc and the team for their patience and persistence in tracking down and eliminating this problem!

2 Likes

Thanks, Tim. All: Hook 3.3 public BETA 5 – Hook has the fix. At this point, we only have minor changes to make to 3.3 before blessing it as an official release.