Paste Wikilink as Text Alias in Obsidian

Hi,
I am trying to use this for pasting Wikilinks from my clipboard into an Obsidian note as an alias for the selected text:

#popclip
name: Obsidian WikiLink
icon: link
requirements: []
actions:
  - type: paste
    content: "[[%clipboard%|%text%]]"

The extension remains greyed out. What am I missing?

There are no fields named ‘type’ or ‘content’ in the action, so PopClip ignores them and perceives it as an “empty” action, resulting in a grayed-out icon.

Did you get this snippet from an LLM? Unfortunately, it seems to have hallucinated some non-existent fields, which can happen when they attempt to create PopClip extensions.

Based on what it looks like you are trying to achieve, this should work:

// #popclip
// name: Obsidian WikiLink
// icon: link
// language: javascript
// requirements: []
popclip.pasteText(`[[${pasteboard.text}|${popclip.input.text}]]`);

(The above block is an extension snippet — select it then click “Install Extension” in PopClip.)

2 Likes

Thanks a lot, Nick. Yes, I was using Claude to help with the code and it seems that it went on a hallucination trip :sweat_smile: