Any success using Hook and Notion together?

I contacted the Notion support/feedback channel and sent them my version of the “suggested email” to developers. Received this response.

“Thanks for writing in. We’ve actually had a few other developers write in about support for Hook before (apple script as well). I’m happy to add a +1 in our internal feedback tracker to add support for this feature.”

1 Like

I have been investigating Notion which seems very powerful. On the other hand I am already a Hook user and do not want to give that up. I am using a workaround to get sort of clickable links in the Notion web app and Mac app as follows:
(1) I paste in the markdown link to say a file on my Mac using the paste as code option in Notion. This stops Notion stripping the markdown from the link. True it then shows the entire markdown link in a code block, but at least you can tell what it is.
(2) To click the link to the file from Notion, I click anywhere on the code block containing the markdown link.
(3) Then I invoke PopClip using a keyboard short cut (mine is Option-Command-P). PopClip immediately recognises the markdown as a hyperlink and gives the “link” option as its default action.
(4) Just press return and you are taken to the file in the link.
It sounds clunky, but it works quickly in practice.
This is my first post here so apologies if this is not up to the required standard for a suggestion to be shared, but I have found it useful.

3 Likes

Welcome to the Hook Productivity Forum , @MrC , and thanks for sharing!

Another trick is: once you have a URL or full link in the clipboard (whatever format), you can use Focus on Link in Clipboard – Hook.

Thank you for doing that, @afischlinguist, and Welcome to the Hook Productivity Forum.

thank you so much for that workaround. integrated it into a keyboard maestro macro and it works flawlessly. solved a lot of problems for me.

1 Like

Welcome to the Hook Productivity Forum , athman. Glad it helps.

I am looking for clarification on what is, and is not, possible to do with Hookmark and Notion as of now - April 2023. The “Using Hookmark with Notion” webpage still says that Notion does not have an API. They do now have an API. So far, the only thing I seem to be able to do is hook whole pages in Notion through Hookmark. Yet each Notion page has blocks that also have links. Is it possible to get Hook to pull up those block links so that I can link specific blocks to items outside of Notion? (Thank you to pug who posted a workaround above that you can simply replace “https” with “notion” on the links to notion. I do that when I want to paste a link to a specific Notion block, say in the notes area of a Things3 project).

Also, after reading the discussion above, including the Applescript posted in 2021, I am struggling to understand how to use that script to solve the problem of the Notion limitations on posting linkable, clickable URLs inside it. Could someone please explain a bit further for this non-techie (though reasonably computer savvy) person? Ideally I would like to paste Things3 links into Notion as well as links to files on my Mac desktop. I realize I can embed files into Notion, but I really don’t want that – I just want to link out. The Popclip workaround described above doesn’t work for me unless I select the whole length of the link in Notion first (and they are long . . . )

Thank you for any insights.

1 Like

To paste hook url into notion, a workaround is to convert hook url into http url, and convert it back using 301/302.
For example, service like https://spx.vercel.app/ converts arbitrary url scheme into http url and can be pasted into notion. When click the http url, this site redirects you back to the original hook url.

If worried about security, you can host a small python http server locally with you own url convert rule(e.g. hook://xxx to http://localhost/hook/xxx), with the limitation of accessing http url on local computer only.

For automation, a simple solution is to define a new paste shortcut using keyboard maestro for example that reads current clipboard, converts hook url to http url, and outputs http url.

1 Like

I’m not familiar with vercel.app/ . However, we have developed Copy As Universal Link . These kinds of links work only in Safari at the moment.

The logic of spx.vercel.app is simple (here is source code GitHub - inlife/spx: Proxy a URL with a custom scheme):

  1. when entering a url, the website encode it and prepends it with https://spx.vercel.app/1/. For example, entering “hook://spotify/track/4yO5ZFxqat5rGGY88vW5RN” returns https://spx.vercel.app/1/hook%3A%2F%2Fspotify%2Ftrack%2F4yO5ZFxqat5rGGY88vW5RN
  2. when accessing the returned url, the website returns http status 302 and redirects you back to decoded url, i.e. hook://spotify/track/4yO5ZFxqat5rGGY88vW5RN.

I didn’t know about universal link before you mentioned it(this document is hidden quite deep). It’s similar to the workflow I mentioned. Their differences:

  1. hook’s universal link can only be opened inside safari. The 302 method can be opened in any browser.
  2. the 302 method requires hosting an actual website that replies 302 only.

Several thoughts:

  1. Is it a good idea to host a web service similar to spx.vercel.app on hookmark.net? Thus no limitation of safari-only.
  2. For desktop computer, the 302 can be implemented by writting a small browser extension without actually accessing a website.
3 Likes

From previous solutions discussed, this works really well for me! Just one question, could you explain how to ‘automatize’ the conversion with Keyboard Maestro without accessing the webpage of vercel.app every time I need a new URL link?

I wrote a python script and let Keyboard Maestro to execute it:

from urllib.parse import unquote, quote_plus
import sys
for hook_url in sys.stdin:
  print("http://spx.vercel.app/1/" + quote_plus(hook_url.strip()))

But now I’ve turned to use hook’s internal universal link, which converts hook url into http url starting with https://hookmark.net/hm/hook/. I also uses a chrome extension to redirect the http url back to hook url, thus bypassing the safari-only limitation. This is to avoid the situation where vercel.app’s service is no longer available one day.


This is the redirect rule:

# From
^https://hookmark.net/hm/hook/(.*)
# To
hook://$1