✪ Link Clipboard
Markdown link with clipboard content

Script key: Markdown link with clipboard content

Posted by @macography

Install

Details

Label ✪ Link Clipboard
Voice Over Markdown link with clipboard content
Script
// Create Markdown link

var sel = getSelectedText();
var selRange = getSelectedRange();
var clip = getClipboard()

if (!sel || sel.length == 0) {
  setSelectedText("[](" + clip + ")");
  setSelectedRange(selRange[0]+1,0);
}
else {
  setSelectedText("["+sel+"]("+clip+")");
  setSelectedRange(selRange[0]+selRange[1]+3,0);
}

Advanced

Keyboard shortcut None
Hide key Yes

Discussion

comments powered by Disqus