✪ []

Script key

Posted by Rob Malanowski

Install

Details

Label ✪ []
Voice Over
Script
// If you have text selected, this wraps that text in brackets, and adds [1] after, with the 1 selected.
// If no text is selected, this assumes you are in the footer, right before your URL. Default is 1, but the number is selected.

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

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

Advanced

Keyboard shortcut None
Hide key Yes

Discussion

comments powered by Disqus