Invoking `hook://` directly?

I am using the app “Tana”, which does not have the ability to fully integrate with Hookmark using a Script; it is an electron app, and it cannot be interrogated easily. It does have a registered URL scheme (tana://) and you can directly navigate to Tana content using that, and so it can at least be integrated into my Hooked bookmarks. However you cannot interrogate Tana for that value from the outside. What it does support though is command building, and I think I could whip up a Tana Command that assembles an URL and opens it, and so I just need a way to communicate with Hookmark using just an URL.

Reading the Hookmark docs, I see a number of integrations using hook://x-callback-url invoking a number of endpoints (file, setCurrentNode, link, link-to-new), and I wonder if I can target these URLs directly? I see they are mainly used indirectly, as callbacks (duh) but I don’t see technically why one couldn’t use one directly (browser, open -u etc)

I have tried several dozen tests, using every example I could find in this forum and the docs, but cannot get anything to replicate the behavior of ^H.

Is there an x-callback-url variant that I can use to hook an arbitrary link? Thanks!

Thank you for contacting us, @threecheese .

Our x-callback-url is mainly for internal use and it is not complete.

We do support AppleScript and Shortcuts actions which you can use for hooking bookmarks and add/open bookmark. Can Tana use AppleScript or Shortcuts?

Thank you

Unfortunately not; I am trying another way, and maybe this forum can help with my struggle: Tana does support a “Copy link to” function in-app; one can invoke a command palette using CMD+K, which pops up a modal window, and then type the string “Copy link to” followed by Enter, and a parseable “Title (URL)” is sent to the clipboard.
I am using a Hookmark script to invoke this, and I am able to automate this using AppleScript (sending keystrokes) but what I am finding is the command palette does not reliably open; when this happens, the keystrokes get sent into the Tana app’s UI (which is bad lol).
Can I use AppleScript within a Hookmark script to see if the command palette window has successfully opened?
Here’s the script:

set the clipboard to ""
delay 0.5
tell application "System Events" to tell process "Tana"
	
	keystroke "k" using {command down}
	delay 1
	# Problem: CMD-K sometimes doesnt do anything
	keystroke "Copy link (HTML formatted)"
	key code 76
	delay 1
	set copiedUrl to the clipboard
	
end tell
#TODO parse the copiedUrl into markdown and `return` it

Thank you. btw this isn’t “production” software, and so I don’t at all mind using a half-baked url scheme; goodness knows I write half baked software 4 out of 5 days per week :slight_smile: