Hook + Logseq = ❤️

Nice! Logseq has release URL Scheme in latest nightly release version, Does Hook has any plan to integrated with Logseq?
This will be awesome!

4 Likes

1 Like

This is the content of Logseq URL Scheme:

1 Like

Welcome to the Hook Productivity Forum , @mzwlevi. It doesn’t look like there’s a keyboard shortcut for it, and that doesn’t look like a standard menu. Is there automation for this?

Until then , once you’ve copied a link within Logseq, you can then invoke Hook and do Focus on Link in Clipboard.

1 Like

Thank for your reply, Using Focus on Link in Clipboard can get the address from Logseq, but no name(maybe we can select the content then trigger Hook: like the Marginnote3, but I do not know how to achieve it):


Now the Logseq has release the 0.6.6 version:
This is the link: Release Desktop/Android APP 0.6.6 (Beta Testing) · logseq/logseq · GitHub
This is the explanation of URL Scheme Feature: Feat: open action for logseq protocol by cnrpman · Pull Request #4881 · logseq/logseq · GitHub

I don’t know how to write the script of Logseq in Hook, but I think Hook integrated with Logseq will be wonderful. Logseq is an outline app with bidirectional links(like Roam Research), Hook can connect the external resources with the internal knowledge base in Logseq.

Could you spare me a few minutes to check if Logseq can be integrated with Hook? Thank you!

1 Like

trying to think how to get this done as well

2 Likes

I don’t think Logseq has an API for this, but perhaps they would be amenable to providing it:

3 Likes

:pray: Thank you for your reply, I will try to contact the developer of Logseq, maybe they will support an API for this in the future.

1 Like

just checking if there is any update on this

1 Like

Hi, I have contacted with the developer of Logseq, they will add support for Hook, maybe we will see the integration of hook and Logseq later.
Thank you for work, they say Hook has contacted with them on Twitter, but do not know how to achieve it, now they start do some work with it.
Screen Shot 2022-07-08 at 22.52.54

1 Like

@LucB The developer of Logseq has added the x-callback-url getCurrentURL

1 Like

Thank you for letting us know! I checked last night build and it seems the feature is not there yet. We will work on the integration with Logseq once this feature is available.

2 Likes

@mzwlevi, any news regarding ETAs for that? Or maybe it’s in already?

I also wonder if this feature will ever come to logseq

There’s a Twitter thread on the subject if you’d like to join the discussion there. I wrote:

A logseq rep asked on Twitter

what can we do to help you become an even better coder?

I answered

Make your app linkable. That’s what leading Mac developers have done: Manifesto for Ubiquitous Linking
cf. Information for Developers to Make Their Apps Linkable (API Requirements for Compatibility with Hook) – Hook

The rep seemed to think that linkability just entails having a UI for linking, as he wrote:

@LucCogZest We already have a URI scheme with logseq:// You can right-click a block or page title to get its link." / Twitter

I replied that

the manifesto calls for automation to obtain the link and title of the resource https://linkingmanifesto.org/technical-requirements/…. Any form of automation will do. The manifesto is agnostic about the API language.

Please feel free to chime in there.

FYI

I just wrote this, if there is any misunderstanding, please help explain.
If anyone sees this message, please click on the link above and click vote in the upper left corner, this will help Logseq pay more attention to this feature request.

1 Like

Welcome to the Hookmark Forum, @hexinzhe, and thank you for this. That helps. I have added a comment there.

it is sometimes useful to reference the Manifesto for Ubiquitous Linking for devs and their community to appreciate the full context. I’ll mention that next.

I am not a good applescript programmer, but I wrote this to make hookmark work with logseq.

You must replace MYGRAPHNAME with the name of your logseq graph (which you can see when you copy a block URL). You must also add :editor/copy-embed "mod+shift+c" to :shortcuts in config.edn. If there is a keyboard shortcut for copying block URL this would not be necessary, but there isn’t, so I have to change the block reference to a URL myself.

set savedClipboard to the clipboard
set the clipboard to ""
tell application "Logseq" to activate
tell application "System Events"
	keystroke "c" using {command down, shift down}
	delay 0.05
	repeat 10 times
		try
			set blockRef to the clipboard
			if blockRef is not equal to "" then
				exit repeat
			end if
			keystroke "c" using {shift down, command down}
		end try
		delay 0.05
	end repeat
	set blockUrl to "logseq://graph/MYGRAPHNAME?block-id=" & characters 11 thru -5 of blockRef as string
	keystroke "a" using {command down}
	delay 0.05
	keystroke "c" using {command down}
	delay 0.05
	set blockContents to the clipboard
	set blockLength to (get length of (blockContents as text))
	if blockLength is less than 32 then
		set linkTitle to blockContents as string
	else
		set linkTitle to (characters 1 thru 32 of blockContents as string) & "..."
	end if
end tell
set the clipboard to savedClipboard
return "[" & linkTitle & "](" & blockUrl & ")"
3 Likes

Awesome! thanks for sharing. We’ll have a look. We want to support logseq ASAP.

2 Likes

I tried to paste this into the script gallery in Hookmark for Logseq under the Get Adress, but I couldn’t get it to work. How do you use this script?