Hooking Curio documents, whether using the built in linking or the deeplink script (see Using hook with Curio) create a verbose header that starts everything with Curio project
.
Here’s a short script that can make things easier to parse:
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.