Would like to replace a variable and embed it in a code line / Surround

I would like to replace a variable and embed it in a code line:

So for example if I mark the following variable (input):

XXXXXXXX

it should be replaced by the following line (result):

<p>Share PMID via Email:<a href="mailto:?body=https%3A%2F%2Fpubmed.ncbi.nlm.nih.gov%2FXXXXXX%2F">Forward</a>

Would anyone have any ideas ?

many thanks
Jack

Popclip:

#popclip
name: PMID-Link
icon: PMID
javascript: popclip.pasteText('<p>Share PMID via Email:<a href="mailto:?body=https%3A%2F%2Fpubmed.ncbi.nlm.nih.gov%2F' + popclip.input.text + '%2F">Forward</a>')

(Select all the text and install the extension.)

I would – however – use a text expansion tool here (aText, Typinator, TextExpander, …) to expand this line after pressing e.g. pmid# and automatically putting in the content of your clipboard (the PubMed-ID) at the chosen location.

Kolkrabe

1 Like

works perfect !

thank you so much :slight_smile:

2 Likes