#⬇️
subscript

Script key: subscript

Posted by @nahumck

Install

Details

Label #⬇️
Voice Over subscript
Script
// Subscript numbers, based on Dr. Drang's encircle key

function subscript(s) {
  var pchars = "0123456789"
    , cchars = "₀₁₂₃₄₅₆₇₈₉"
    , count  = pchars.length
    , regex  = new RegExp('[' + pchars + ']', 'g')
    , trans  = {}
    , lookup = function(c) { return trans[c] || c; };
  
  for (var i=0; i<count; i++) {
    trans[pchars[i]] = cchars[i];
  }
  
  return s.replace(regex, lookup);
}

setSelectedText(subscript(getSelectedText()))

Advanced

Keyboard shortcut Option+S
Hide key Yes

Discussion

comments powered by Disqus