Link Obsidian with AdvancedURI Plugin

Thank you!

It seems the fileuri has 4 “///”:
file:////home/…

If it has three “/”, it works.

1 Like

I thought I have to add another slash, because absolute paths on unix start with a slash, but wikipedia has only 3 too.

Released a new version.

1 Like

I’m delighted to see all the progress.

The default Obsidian method of getting the title doesn’t include “+”; but of course it’s currently using the clipboard rather than x-callback-url or other API.

I guess if Obsidian is encoding titles with “+” for space there’s a bug in the Obsidian code. Per URL encoding the space character: + or %20? - Stack Overflow

The reserved characters are different for each part.

For HTTP URLs, a space in a path fragment part has to be encoded to “%20” (not, absolutely not “+”), while the “+” character in the path fragment part can be left unencoded.

Now in the query part, spaces may be encoded to either “+” (for backwards compatibility: do not try to search for it in the URI standard) or “%20” while the “+” character (as a result of this ambiguity) has to be escaped to “%2B”.
[…]
should have %20 before the ? and + after.

of course, we’re not dealing with HTTP URLs, but the principles are the same

Because Hook use x-callback-url with the AdvancedURI, and x-callback-url is asynchronous it would be awkward for Hook to correct the title received by the plugin by comparing the result with the path information (it would have to do that outside the integration script, or Hook could fall back on the Obsidian method which utilizes the clipboard, but relying on clipboard here is awkward).

Tested the fileuri in the new release. Works great!

Thank you!

3 Likes

Is there now a problem or not? As you said, encoding the title as query parameter with + is valid. Since I pass the title as query parameter, I think everything is okay?

1 Like

Yes we shall decode it :slight_smile:

1 Like

@Vinzent03 , Version: 1.20.0 of the Advanced URI no longer has an ID tag, and it is not robust with file moves. When using a URI after a file has moved, Obsidian creates a new file in the old location and opens it.

We still find it helpful to be able to get the path from the Advanced URI that you provide.

I think I never mentioned it, but you have to enable Use UID instead of file paths in the settings. Because it modifies the file to save the uid, it’s not enabled by default.

1 Like

got it. Thank you very much!

1 Like

Is there an estimated date on when this would be integrated with Hook? I frequently link items with Obsidian notes, so it would be great if this can be supported soon. :slight_smile:

1 Like

It should go into 3.4.3 which we will release within a couple of days if all goes well. The release is focused on Obsidian support.

1 Like

@Vinzent03 . So @bchend and I both tested. What we found was: if there is no ID in the file, the Copy Advanced URI in Obsidian UI works fine (it appends the URI to the URL). but the next time, it fails (regardless of whether we move the file).

Bi Ling says the plugin used to work. The change happened after your last modification. If it works for you, maybe it’s a Mac vs. PC/Linux issue. We’re using macOS of course.

If you call the command via the ui

it appends the URI to the URL

you mean uid instead of URI right?

As always, only 4 extra chars should have fixed it. I released a new version.

1 Like

You are right. Sorry for the typo.

Tested the new release. Works great!

Thank you very much for your quick action!

2 Likes

I’ll cross-post this over on the Obsidian community, but I just hit an unexpected quirk and wanted to document it in case others using both Hook and Obsidian experience the same problem.

Set up -
Obsidian: Version 0.15.9 (Installer 0.15.6) with the AdvancedURI plugin installed
Mac OX: macOS Monterey Version 12.5
Hook Method: Using the Advanced URI integration between Hook and OBsidian as described in Using Hook with Obsidian – Hook

After doing some housecleaning on my Obsidian vault, during which I had enabled some other plugins, moved folders around and renamed the vault, the AdvancedURI hook no longer opened Obsidian to the correct note in Obsidian when invoked. I spent two hours testing out hypotheses before realizing that a plugin I was using (Home Page) was interfering with the process.

The moral of the story – any of Obsidian’s plugins may interfere with the expected results of the AdvancedURI hook method, so if you are troubleshooting, start there!

In the meantime I’ve turned off the Home Page plugin, but I do wonder if this is the kind of thing one files a ticket on in Github. If so, would you file it on @Vinzent03’s plugin, or the Home Page plugin?

Cheers, and thanks for these very helpful applications and plugins, and for working together to achieve great outcomes!

Jack Beaudoin (no relation to @LucB I don’t think)

1 Like

The advanced URI plugin embeds the vault name in the URL:

obsidian://advanced-uri?vault=MyVault&uid=8165c0db-4e2d-4007-9ffa-6e19c99e1eaf

Does updating the vault name to match the notes new home in your URLs mend the link?

@LucB - Is there a way to “Hook to new” Obsidian note with multiple vault support? i.e. Either create a separate Obsidian item in the list, or have it bring up a selection box to select from available Obsidian vaults?

Welcome to the Hookmark Forum , @darkwing. I don’t think the integration options don’t currently provide that . There’s

But given how configurable Hookmark and Obsidian is, there might be a way. The Hook to New script for any app can be modified, per Scripts Tab – Hookmark.

Are there any changes in how this works recently. It’s been a while since I tried, but now every time I hook a file then choose new obsidian, i get a new file, rather than opening the old one. so each file will be title, title 1, title 2, title 3, etc.

I am using the Advanced URI plugin, with Use UID instead of paths enabled. I have disabled every other plugin. I am using the Hookmark that is part of Setapp (though I bought Hook a few years back as well). So I wondered if the bundleid is different in the script and the defaults command. Tried setting those accordingly. Both configs don’t work. and both Hooks don’t work. I have restarted both Hookmark and Obsidian just in case. Even restarted the mac. Nothing seems to work. Each test I have tried I have just one instance of hook running (again, I have the Hook I bought, and the Setapp Hook), but noticed this before installing the Setapp version today.

What else can I try.

I see that when I create new from a web page in Arc and Chrome, or from a note in the Notes app on Mac, the frontmatter does not get created in Obsidian. But if I hook the note in Obsidian, the frontmatter does get created.

1 Like

Welcome back, @technovangelist .

There is no change for Obsidian recently.

Could you please elaborate more on this issue? Do you mean you tried to do “Hook to New Obsidian”? If you can post some screenshots, that would be very helpful.

Thank you