🔄
Upside down and backwards

Script key: Upside down and backwards

Posted by agiletortoise

Install

Details

Label 🔄
Voice Over Upside down and backwards
Script
// function to flip text to upside unicode equivalents
function flipText(srcText) {
  var out = '';
  for( var i = srcText.length - 1; i >= 0; --i ) {
    var ch = srcText.charAt( i );
    if( ch == 'a' ) { out += '\u0250' }
    else if( ch == 'b' ) { out += 'q' }
    else if( ch == 'c' ) { out += '\u0254' }
    else if( ch == 'd' ) { out += 'p' }
    else if( ch == 'e' ) { out += '\u01DD' }
    else if( ch == 'f' ) { out += '\u025F' }
    else if( ch == 'g' ) { out += '\u0183' } //1D77' }
    else if( ch == 'h' ) { out += '\u0265' }
    else if( ch == 'i' ) { out += '\u0131' } //1D09' '\u01C3' '\u0131' }
    else if( ch == 'j' ) { out += '\u017F'} //1D98' '\u0638' }
    else if( ch == 'k' ) { out += '\u029E' }
    else if( ch == 'l' ) { out += '\u05DF' }
    else if( ch == 'm' ) { out += '\u026F' }
    else if( ch == 'n' ) { out += 'u' }
    else if( ch == 'o' ) { out += 'o' }
    else if( ch == 'p' ) { out += 'd' }
    else if( ch == 'q' ) { out += 'b' }
    else if( ch == 'r' ) { out += '\u0279' }
    else if( ch == 's' ) { out += 's' }
    else if( ch == 't' ) { out += '\u0287' }
    else if( ch == 'u' ) { out += 'n' }
    else if( ch == 'v' ) { out += '\u028C' }
    else if( ch == 'w' ) { out += '\u028D' }
    else if( ch == 'x' ) { out += 'x' }
    else if( ch == 'y' ) { out += '\u028E' }
    else if( ch == 'z' ) { out += 'z' }
    else if( ch == '(' ) { out += ')' }
    else if( ch == ')' ) { out += '(' }
    else if( ch == '{' ) { out += '}' }
    else if( ch == '}' ) { out += '{' }
    else if( ch == '[' ) { out += ']' }
    else if( ch == ']' ) { out += '[' }
    else if( ch == '<' ) { out += '>' }
    else if( ch == '>' ) { out += '<' }
    else if( ch == '0' ) { out += '0' }
    else if( ch == '1' ) { out += '\u0196' }
    else if( ch == '2' ) { out += '\u01A7' }
    else if( ch == '3' ) { out += '\u0190' }
    else if( ch == '4' ) { out += '\u152D' } // 056B' }
    else if( ch == '5' ) { out += 'S' }
    else if( ch == '6' ) { out += '9' }
    else if( ch == '7' ) { out += 'L' }
    else if( ch == '8' ) { out += '8' }
    else if( ch == '9' ) { out += '6' }
    else if( ch == '?' ) { out += '\u00BF' }
    else if( ch == '\u00BF' ) { out += '?' }
    else if( ch == '!' ) { out += '\u00A1' }
    else if( ch == '\u00A1' ) { out += '!' }
    else if( ch == "\'" ) { out += ',' }
    else if( ch == ',' ) { out += "\'" }
    else if( ch == '.' ) { out += '\u02D9' }
    else if( ch == '_' ) { out += '\u203E' }
    else if( ch == ';' ) { out += '\u061B' }
    else if( ch == '"' ) { out += '\u201E' }
    else if( ch == "'" ) { out += ',' }
    else if( ch == '&' ) { out += '\u214B' }
    else { out += ch }
  }
  return out;
}

// run on selected text...
setSelectedText(flipText(getSelectedText()));

Advanced

Keyboard shortcut None
Hide key Yes

Discussion

comments powered by Disqus