Any success using Hook and Notion together?

thanks for the clarifications, @timstringer . I agree with all your points. A lot of people use and love Notion, whether for “all in one” or parts of it. I had heard about their API. If anyone has particular knowledge of it, please feel free to give us an update. We would love to add Notion.so integration to Hook.

Even today, users can bookmark Notion.so items with Hook, and find them via ⌘F, and hook them from there. So basically any software, like Notion, that provides a Copy Link function is compatible.

1 Like

@LucB Notion releases their API as public beta tomorrow May 13th.

https://i.imgur.com/d0JX5e0.png

1 Like

@bchend please have a look (it’s our 3813).

Hi @LucB
I’m so curious - how’s the progress on integration with Notion coming along?
Hook and Notion are my two “brain”-apps, and having them separated is what I can imagine having a split personality is like. :smile:

Sorry @pug, my assigning via Discourse above rather than our internal tracking system led to it being overlooked. It’s still in a dev’s pipeline here. Hook 3.2 public beta any day now, with several significant new integrations.

1.As I tweeted to @NotionHQ, Notion doesn’t seem to have a client-side API. No AppleScript dictionary and I couldn’t find a x-callback-url on the web. Am I missing something?

I also resumed an email thread with Notion that I had started in spring of 2019 (and continued in 2020).

2. Apparently they have a very active user community and forum. So if any notion user wants to ask a question on their side that might help.

3. I also verified that their Mac app still has a major limitation: Notion still does not support local app links, not even its own! You can paste app URLs like hook://file/, and notion URLs in Notion app, but they will not be treated as hyperlinks. If you paste a markdown link with whose URL field is an app URL, Notion will strip away the URL and just give you the label.

this does not merely affect Hook, it affects all apps. So you can’t even paste a not Notion URL or Markdown , let alone an OmniFocus, obsidian, x-devonthink-item or Things URL/markdown-link in Notion.

If I were a Notion.so user, I would be quite concerned about that.

5. However, Hook can help you get around these limitations via this UI-scripted integration ,

tell application "System Events"
	tell process "Notion"
		set the clipboard to ""
		delay 0.5
		
		keystroke "l" using {command down}
		repeat 50 times -- poll clipboard for ~2.5 seconds
			try
				if (the clipboard) is not equal to "" then
					exit repeat
				end if
			end try
			delay 0.05
		end repeat
		set myUrl to the clipboard
		set myUrl to "notion" & text 6 thru (length of myUrl) of myUrl
		
		set AppleScript's text item delimiters to {"/"}
		set myItem to last item of text items of myUrl
		set AppleScript's text item delimiters to {"-"}
		
		if (count of text items of myItem) > 1 then
			set myItems to items 1 thru ((count of text items of myItem) - 1) of text items of myItem
			
			set myTitle to myItems as string
		else
			set myTitle to name of window 1
			
		end if
		return "[" & myTitle & "](" & myUrl & ")"
	end tell
end tell

please let us know if that works

6.Like I said in #2 above, I heard on MPU that Notion.so has a very active user community and forum. So if any Notion user wants better integration, I recommend they take it to Notion’s forum, and link to this post.

In my communications with Notion I have also linked to this post.

Any updates about this re: Notion and Hook? I’m using Obsidian these days for note-taking and would like to link from my projects in Notion to Obsidian notes. Finally purchased Hook after trying it a few times on the trial, because I think it has promise, but found it still doesn’t work as a clickable link in Notion. Not disappointed about the purchase, as I wanted to test it in other ways, but wanted to ask about updates since I’m not sure if the consumer-side API with Notion has changed anything with this. @LucB

Just saw this on Reddit so it doesn’t seem promising…

Hook can work with any API, including if written in JavaScript, so JS should not inherently be a problem.

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?