Text Fields in Keyboard Maestro

Keyboard Maestro has two very distinct types of fields: text fields and numeric fields.

The difference is usually obvious. Numeric fields start out small, and have the double arrows next to them:

and then expand to allow more text if you type something other than a simple number:

Numeric fields have a numeric expression in them, which can include variables and functions. Eg "Count + 2 * DOW()". To use a variable in a numeric field, you use it as is, without any adornment.

If the function is invalid, it will highlight in red. Keep in mind that the expression may be invalid simply because a variable it references does not yet have a value. If you have not set the Count variable to a value, then the above action would look like this:

This is nothing inherently wrong with the action - the variable Count just does not currently have a numeric value.

You can insert functions into numeric fields using the ''Edit ➤ Insert Function" menu.

Text fields, on the other hand, start out larger. They may be single line, or multi-line, and may expand to more lines to fit (within limits) the content. Text fields process text tokens, which you can insert using the ''Edit ➤ Insert Token" menu. They also process backslash characters (eg \r, \n, \t, etc) (except in regular expression fields). Text fields can include the values of variables by using the Variable token, eg:

You can use a calculation in a text field using the Calculate text token, eg %Calculate%1+2%

Almost every field in Keyboard Maestro actions is either a numeric field or a text token field. The major exceptions are:

  • Scripts - scripts are not processed for text tokens, they must access variables through other means.
  • Select Menu Item text - these have their own processing, but do not process text tokens.
1 Like