# Obsidian Hook to New from Safari title issue

**URL:** https://discourse.hookproductivity.com/t/obsidian-hook-to-new-from-safari-title-issue/7240
**Category:** Bug Reports
**Created:** [October 13, 2023, 8:46am UTC](https://discourse.hookproductivity.com/t/obsidian-hook-to-new-from-safari-title-issue/7240 "2023-10-13T08:46:48Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![psidnell](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/psidnell/32/1575_2.png) [@psidnell](https://discourse.hookproductivity.com/u/psidnell)
#### Post date: [October 13, 2023, 8:46am UTC](https://discourse.hookproductivity.com/t/obsidian-hook-to-new-from-safari-title-issue/7240/1 "2023-10-13T08:46:48Z")

</div>

Hi,

I’m seeing a new issue doing a hook to new Obsidian document using the advanced URI scheme from a web page.

For example:

- In safari I’m on “[Home - BBC News](https://www.bbc.co.uk/news)”
- I Hook to New and choose Obsidian (I’m using the Advanced URI scheme)
- The document is created - but with a title of “Home%20-%20BBC%20News”

I don’t know if this is an issue with Hookmark or the Advanced URI plugin. I think I noticed it about a week ago.

---

<div class="post-metadata">

### Author: ![psidnell](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/psidnell/32/1575_2.png) [@psidnell](https://discourse.hookproductivity.com/u/psidnell)
#### Post date: [October 13, 2023, 9:16am UTC](https://discourse.hookproductivity.com/t/obsidian-hook-to-new-from-safari-title-issue/7240/2 "2023-10-13T09:16:04Z")

</div>

The AppleScript for the Obsidian New Item script is somewhat above my pay grade, but I think there’s a double encoding of the title going on.

When I comment out the encoding on line 88 it seems to fix the issue:

```auto
if prefUrl is "obsidian-advanced-URI" then
	set urlKey to "advanceduri"

	-- An invalid value for com.cogsciapps.hook integration.obsidian.URL.scheme has been set. There, we present the following options and set the default here.

	-- set encodedTitle to theString's stringByAddingPercentEncodingWithAllowedCharacters:charset

	set callbackURL to callbackURL & "?src=" & encodedSrc & "&urlKey=advanceduri&plusencoded=yes"

```

---

<div class="post-metadata">

### Author: ![bchend](https://discourse.hookproductivity.com/letter_avatar_proxy/v4/letter/b/dbc845/32.png) [@bchend](https://discourse.hookproductivity.com/u/bchend)
#### Post date: [October 13, 2023, 6:44pm UTC](https://discourse.hookproductivity.com/t/obsidian-hook-to-new-from-safari-title-issue/7240/3 "2023-10-13T18:44:45Z")

</div>

Thank you for reporting this issue and help debug the problem!

We just updated our script server with the fix, script version 298.

Thank you
