Double clicking a .hook file created via `Hook to New` from some URLs does nothing

Hi folks,

When I first installed Hook, I fell in love with .hook files. I use Curio as a part of my workflow to organise my project life, while my company uses Sharepoint. .hook files allowed me to link directly to sharepoint URIs from a folder in curio by simply double-clicking the .hook file to launch Sharepoint in a browser or open a Word doc or Excel sheet from SP. Suddenly these things don’t work anymore, and double clicking a hook file does nothing. I’ve tried making .hook files to local folders on my mac to rule out some sharepoint weirdness, and even these don’t work.

How do I troubleshoot this?

welcome to the Hook Productivity Forum, @smckay
I recommend copying the URL from a .hook file and putting it into Spotlight or LaunchBar to see if it works. If it does, then that suggests either a syntax issue in the .hook file, or that the association between .hook extension/files and Hook app has been lost. Latter is more likely (though I haven’t seen it), and would likely be a macOS user account config issue.

Hi @LucB. Thanks for the quick assist.

I’ve tried the Spotlight approach, and the URI in the .hook file works okay. But it doesn’t seem to be a file association issue either, as Finder reports that .hook files are associated with Hook.

It may be relevant that I recently migrated my user profile and applications to a new mac book pro via the apple migration assistant. There have been a few permission issues, but I’ve checked that Hook has full disk access and ticks in all the automation options, including for my default browser which is ‘Brave’.

I tried reinstalling Hook also, in case something had been messed up during the migration, but it doesn’t seem to have made any difference.

I’ve posted a video capture of the issue here https://youtu.be/ljUNtvrJSkM in case that helps. I may be overlooking something a more experienced eye would notice.

Are there any logs I shoud check for errors or warning that might provide some clues?

Regards
Stephen

I recommend this web page from Apple: Choose an app to open a file on Mac - Apple Support, which has a section " Permanently change the app used to open a file".

In step 4, you would choose “Hook” as the app to open .hook files with.

  1. On your Mac, click the Finder icon in the Dock to open a Finder window.
  2. Select a .hook file, then choose File > Get Info.You can also Control-click the file, then choose Get Info.
  3. In the Info window, click the disclosure triangle next to “Open with.”
  4. Click the pop-up menu, then choose the Hook app.To open all files of this type with this app, click Change All.

that should work.

Hmm, I’ve already done that.

Clicking the hook file still does nothing. The URI in the .hook file is just a https:// link and it’s well-formed and opens correctly via spotlight. It just seems like Hook doesn’t know what to do with the “https://…” URI.

Have you already tried setting the default app to something random (clicking change all) then changing it back again (and clicking change all again)?

Is it possible you have multiple instances of Hook, and when you double click on a .hook file, macOS launches a different one?

@stevelw - yup. Been down that road.

@LucB Only one instance of Hook.app is installed.

I’ve noticed this behaviour today, and it’s interesting.

I created a Hook file from a random internet URL just to see if I could create anything that worked in a .hook file. It was this “https://documentation.commvault.com/commvault/v11/article?p=37032.htm” and, lo and behold the hook file works fine. (WT#…?)

The non-working URI’s are all Sharepoint links. Those are kind of long - the one I’ve been playing with is 498 characters long.

Is there a maximum URI length that Hook will handle? Could it be related to the URI length?

thanks for your persistence and for letting us know.

I had noticed a URL in your video was long but dismissed that idea when it worked in Spotlight. Could you please send me a sample URL in a PIM (assuming it doesn’t give me access to the item, which I don’t need).

Thank you.

We’ve found an issue with URLs with escaped characters such as space that would explain what you’ve observed. It does not apply to hook://file URLs however.

I assume you have no instance of a .hook file that used to work and then stopped working. If I am wrong, please let me know.

Thanks for your diligence in working on this, Luc. I really appreciate it.

I just PM’ed you a URL via Twitter. (Couldn’t figure out if the forum had a PM feature.)

@LucB. Thanks again for taking the time to look into this - is there any further feedback at this stage?

Is there a way to test if the issue with escaped characters is part of my issue?

Hi @LucB,

While you are working on a permanent fix, do you have any recommendations? Is there a possible workaround by creating an ‘open’ script for Brave or Safari?

Hi @smckay. The types of URL generated by sharepoint clash with Hook’s hook://file URL encoding. It’s fixed internally. I’ve requested an internal private build which I’d like to distribute to you if you’re willing to try it out. I’ll follow up in a PIM.

I’m slightly renaming and moving this topic to the Bug Report forum category.

The work-around for .hook files affected by this issue is to manually edit the .hook file, pasting in the desired URL. Not ideal, but gets the job done. (One of the major advantages of .hook files being editable plain text files).

.hook files can contain a single URL or a sequence of 1…n markdown links, but currently only the first URL/link is opened when one launches a .hook file. As discussed elsewhere on the forum, we may extend the schema and Hook’s behavior for .hook files, possibly also providing an additional file type and/or option where a regular application Hook-like window would be presented on them (i.e., beyond a popup, a window that remains open–that would be an additional way to use Hook for project hubs). But for now, best for users to stick with the current .hook schema when editing .hook files.