User Tools

Site Tools


token:Calculate

Table of Contents

**This is an old revision of the document!**

Calculate Token

The %Calculate%<formula>% token returns the numeric result of performing a calculation,
where <formula> may be any of the following:

  • Mathematical formula like (2 + 3)*12
  • Use any Variable which may be evaluated as a number
    • :!: Just enter the Variable Name (without the %) in the Calculate token <formula>
    • Examples:
      • %Calculate%MyVar + 1%
      • %Calculate%(MyVarWordsPerSec * 60)/MyVarWordsPerPage%
  • Use any of the built-in Keyboard Maestro functions, like RANDOM(10)
  • Get the numeric value of an Variable array element, like MyVar[2]
    10,05,12,08” returns “5
    (Arrays may contain only numeric data)

Example Action

A reminder that the following are only equivalent if the Variable is numeric:

  • %Variable%Count% (Variable)
  • %Calculate%Count% (Number)

So, if MyVar is “005”, then

  • %Variable%MyVar% will return 005
  • %Calculate%MyVar% will return 5
token/Calculate.1474302746.txt.gz · Last modified: 2016/09/19 12:32 by JMichaelTX