Click link in browser to folder on desktop?

I want to move from working on a webpage to a folder on my desktop, or ideally, within a program, to maintain flow and avoid getting distracted.

How can I do that?

As an example, I made this GreaseMonkey script for WhatsApp. It edits the whatsApp page to add a button that copies a command to navigate to a folder related to that page. Unfortunately, the script keeps breaking as WhatsApp changes itā€™s pages. Also, browser security prevents a direct flow to the filesystem now so it would also need an automate script watching the clipboard for that to work.

Thereā€™s got to be a way for Hook to help me do this but I canā€™t seem to figure out how to do it.

Another thing I tried, was pasting a link to a folder directly into the chatbox like this:

[Documents](hook://file/8IDy4mlRd?p=VXNlcnMvag==&n=Documents)

^ but as you can see, this link is not clickable. How can I make that link clickable?

Notes:

  1. Iā€™m prepared to change browser, if it helps
  2. Iā€™m prepared to paste hook links into WhatsApp as "Note to self: (the hook link)

For whatever design reason, messaging software is amongst the least linkable software. (cf. Manifesto for Ubiquitous Linking). In Apple Messages for instance you canā€™t get the URL of a message. And when you paste a RTF or HTML app link, Messages takes the name not the URL. The work around in Messages is to paste a Markdown link.

Safari (for instance) is fine with app links, but it depends on the web app. For instance, Discourse forum does not like app links. The work around is to copy the app link and paste it into Spotlight. Select, āŒ˜C, spotlight-shortcut, paste, return. Not instant but gets you there.

For some data a work-around is to create proxy objects (or files) and link to them. Not ideal.

Once you have a URL in the clipboard, you can use Hookā€™s Focus on Link in Clipboard to use Hookā€™s functions with it.

An extension for Chrome/Brave/Firefox can surely fix this? In fact, thereā€™s surely an extension already out there for this?

For example, altering this to copy a HOOK:// link to the clipboard to then paste into spotlight

edit: Adding hook:// to the end of the protocols line didnā€™t work :frowning:
Seems a custom regex pattern is needed

I donā€™t know how to write a custom regexā€¦

hook://[a-z0-9]{2,}[:-][^[\]{}<>\\|~^"`\s]+

isnā€™t workingā€¦

I did it!
I can now use click Hook links on any browser page :slight_smile:

The setup is:

  1. Install Linkificator for Firefox or Chrome (Chrome untested at the moment)

  2. In extension options,

Apply Custom Rules for:
Before predefined rules list
enable this ā€”> After predefined rules list

  1. Add " hook://~hook:// " to Protocols and subdomains. Iā€™m not sure if this is really necessary.

  2. Now add a custom rule:

Name: hook
Pattern: hook:(.*)
URL: $&

Youā€™ll now have hook:// links highlighted and clickable on every page.

To finally use WhatsApp as a CRM, you can send your customer your hook link and just ask them to ignore it with a ā€˜note to selfā€™ or annotate the page with another extension, perhaps?
Then when you want to refer to your customer notes, you just click that hook:// link in your WhatsApp conversation.


Edit:

You can also use this in:

  • your emails
  • forum posts

Itā€™s pretty handy.

update 01-21-2022:
I found that it sometimes breaks the reply box in WhatsApp. Itā€™s probably because it needs to stop after the final character in the hook:// link. Maybe (.*) needs to be edited to exclude a blank whitespace

2 Likes

Update:

You can link from say, ObsidianMD to a WhatsApp conversation with:

Where 01999ā€¦ is the phone number you want to link to, with the ā€œ+ā€ for the country extension removed.
You can also use the group invite feature to link to a group, but sadly youā€™ll need to be group admin for that.

This significantly reduces interruptions in flow but itā€™s not using Hook in this direction, sadly and without choosyosx.com , itā€™ll just open in whatever your default browser is.

A general productivity note:
Note back to a note in Obsidian and then have a link to the folder. That central note is more useful.


Edit, update. This is quicker:

% cat .finicky.js
// Generated by Finicky Kickstart 
// Save as ~/.finicky.js

module.exports = {
  defaultBrowser: "Firefox",      
  handlers: [
    {
      match: /^https?:\/\/whatsapp\.com\/.*$/,
      browser: "WhatsApp"
    },
    {
      match: /^https?:\/\/api\.whatsapp\.com\/.*$/,
      browser: "WhatsApp"
    },
    {
      match: /^https?:\/\/wa\.me\/.*$/,
      browser: "WhatsApp"
    }
  ]
}
1 Like

Does anyone have a better implementation for this?

I want to send my coworker a HOOK:// link via whatsapp web and have her be able to click and open the link on a shared resource. She uses Chrome, unlike me.

Itā€™s actually not much bother to copy the link, paste it into spotlight and find it that way, but it would be nice to have a single click operation.

edit:
I feel a bit stupid for not thinking of this, but you can just send them a .hook file!