=
Calculate

Treat the selected text as a numeric expression, evaluate it’s result and replace the selected text with that result.

For example, tap this key on a text selection of “2+2” and it will be replaced with “4”.

If no text is selected, or the result of evaluating the text is an error, no changes are made.

Posted by agiletortoise

Install

Details

Label =
Voice Over Calculate
Script
// evaluate the current text selection
// as a numeric expression
// and replace with the result

var s = getSelectedText();
var result = eval(s);

if (result != undefined) {
  setSelectedText(result);
}

Advanced

Keyboard shortcut None
Hide key Yes

Discussion

comments powered by Disqus