I am finding myself often embedding links with custom text, which in obsidian uses this form:

Costume text which shows on the original page

Is there any way to do this through a shortcut the same way I can internal link, link-embed, and external link?

In short,
I have CMD-L mapped to [[]] And CMD-J mapped ![[]] And CMD-K mapped to []()

Is there anyway to get something mapped to the text I just selected is now contained here?

Marble_Wraith • 9d ago

Though i’ve never tried it, in theory it’s possible with a templater script… so how good are you with code? 😅

If you have the text Costume text which shows on the original page already present in your active file, you can highlight it, then make a template which gets whatever is highlighted via [tp.file.selection] (https://silentvoid13.github.io/Templater/internal-functions/internal-modules/file-module.html#tpfileselection).

You can also code a prompt or suggester into the template, so if it’s left blank it will use Costume text which shows on the original page as the note name, otherwise use whatever you provide it with like New file name.

Then you bind that specific template insert to a shortcut.

Furthermore you can make it even smarter. For example, if a URL is selected, maybe something from youtube, scrape the video title from that page and make the link look like this [youtube video title](URL).

Reply reply


• 8d ago

Hey, thank you for the response.

I got a similar response on the forum and I just want to put this here for everyone else:

Yes, it is possible through a templater script, available on the forums here, and it works perfectly!