#⬆️
superscript

Script key: superscript

Posted by @nahumck

Install

Details

Label #⬆️
Voice Over superscript
Script
// Superscript numbers, based on Dr. Drang's encircle key

function superscript(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(superscript(getSelectedText()))

Advanced

Keyboard shortcut Shift+Option+S
Hide key Yes

Discussion

comments powered by Disqus