Trying to create an extension

Hi, I’m trying to create an extension for German dictionary search, which will be open with Microsoft Edge.

Here is what I tried, but instead of searching for the specific keyword, it simply searches for the term “term.” Can you please help me to fix this?

# popclip
name: Collins German dictionary
icon: search filled DE
javascript: |
  const term = encodeURIComponent(popclip.input.text)
  const url = 'https://www.collinsdictionary.com/dictionary/german-english/${term}'
  popclip.openUrl(url, {app: 'com.microsoft.edgemac'})
2 Likes

It’s just a matter of the string notation.

To use template literals like ${term}, you need you strirng to be surrounded with backticks:

`${term}`

not

'${term}'
2 Likes

Now it works! Thank you!

1 Like