# Formatting Curio link names

**URL:** https://discourse.hookproductivity.com/t/formatting-curio-link-names/3305
**Category:** Showcases and Use Cases
**Created:** [May 22, 2021, 5:48am UTC](https://discourse.hookproductivity.com/t/formatting-curio-link-names/3305 "2021-05-22T05:48:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![seishonagon](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/seishonagon/32/99_2.png) [@seishonagon](https://discourse.hookproductivity.com/u/seishonagon)
#### Post date: [May 22, 2021, 5:48am UTC](https://discourse.hookproductivity.com/t/formatting-curio-link-names/3305/1 "2021-05-22T05:48:03Z")

</div>

Hooking Curio documents, whether using the built in linking or the deeplink script (see [Using hook with Curio](https://hookproductivity.com/help/integration/curio/)) create a verbose header that starts everything with `Curio project `.  
Here’s a short script that can make things easier to parse:

```auto
tell application "Curio"
	set theLink to (markdown link to selected item of active document) as string
end tell
set theLink to findAndReplaceInText(theLink, "Curio project \"", "")
set theLink to findAndReplaceInText(theLink, "\" > \"", " > ")
set theLink to findAndReplaceInText(theLink, "\"]", "]")
return theLink

on findAndReplaceInText(theText, theSearchString, theReplacementString)
	set AppleScript's text item delimiters to theSearchString
	set theTextItems to every text item of theText
	set AppleScript's text item delimiters to theReplacementString
	set theText to theTextItems as string
	set AppleScript's text item delimiters to ""
	return theText
end findAndReplaceInText

```

This is not fancy or mysterious: it’s the original deeplink script with the Apple recommended method to replacing text in strings.

---

<div class="post-metadata">

### Author: ![seishonagon](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/seishonagon/32/99_2.png) [@seishonagon](https://discourse.hookproductivity.com/u/seishonagon)
#### Post date: [May 22, 2021, 1:22pm UTC](https://discourse.hookproductivity.com/t/formatting-curio-link-names/3305/2 "2021-05-22T13:22:06Z")

</div>

@georgezengobi came through with some Curio advanced prefs that make the AppleScript nightmare go away. Existing prefs are :

```auto
defaults write com.zengobi.curio "Hyperlink Organizer Item Title Format" -string "Curio project \"%@\" > \"%@\""
defaults write com.zengobi.curio "Hyperlink Figure Title Format" -string "Curio project \"%@\" > \"%@\""

```

Replacing everything after `-string ` makes it do what I want. I have set it up as:

```auto
defaults write com.zengobi.curio "Hyperlink Organizer Item Title Format" -string " %@ > %@"
defaults write com.zengobi.curio "Hyperlink Figure Title Format" -string " %@ > %@"

```

---

<div class="post-metadata">

### Author: ![LucB](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/lucb/32/2228_2.png) [@LucB](https://discourse.hookproductivity.com/u/LucB)
#### Post date: [May 23, 2021, 5:53pm UTC](https://discourse.hookproductivity.com/t/formatting-curio-link-names/3305/3 "2021-05-23T17:53:34Z")

</div>

Thank you very much for digging into this and sharing it, @seishonagon . We have added a section to [Using Hook with Curio – Hook](https://hookproductivity.com/help/integration/curio/) page on the issue; it contains a link to this forum topic.
