User Tools

Site Tools


manual:Tokens

Tokens

Tokens allow you to add textual information to token text fields. You can tell that a field accepts tokens because a small T shows in the field while editing it.

For example, %SystemClipboard% will be replaced by the text in the clipboard.

You can insert tokens into a field using the Insert Token popup near the field or by choosing from the Edit ➤ Insert Token menu. You can also start typing a token and use type completion to complete the token. You can insert a token by name by choosing the Edit ➤ Insert Token by Name menu.

The available tokens are listed on the wiki Tokens page.

Processing

Text token fields also process %NN% or %NNNN% or %NNNNNN% as arbitrary hex unicode characters (eg %41% is an A, %01F300% is 🌀), and (except for regular expression fields) process backslashed characters \a,\b,\e,\f,\t,\r,\n (bell,backspace,escape,form feed,tab,return,line feed).

To include a percent in your text, simply double the percent (). To include a backslash \ in your text, double the backslash (\\). In most text fields, you can select (in the BUTTON{{{⚙}}} menu) whether to process tokens normally, or just tokens (not backslashed characters) or do no text processing at all. Alternatively, to include a percent in your text, simply double the percent (). To include a backslash \ in your text, double the backslash (\\).

Text Case Conversions

Text token fields also support (v9.0+) text case conversion escapes. The most common use is to change the case of an interpolated variable or other token, as well as in Search and Replace by regular expression action. The conversion escape codes are:

  • \U converts everything up to the next \L or \E to uppercase.
  • \L converts everything up to the next \U or \E to lowercase.
  • \u converts the next character to uppercase.
  • \l converts the next character to lowercase.
  • \U\l lowercase first, then uppercase.
  • \L\u uppercase first, then lowercase.
  • \E stop changing case.

You should not use \u after \U or \l after \L unless you terminate the sequence with \E first.

Arrays

With tokens that commonly contain arrays of information, you can easily access the individual parts using the token array notation, eg %TriggerValue[3]% will be the third comma-separated value, and %TriggerValue[3];% will be the third semicolon-separated value, and %TriggerValue[3] % (note the space between the ] and the %) will be the third space-separated value (8.0.4+). This currently works with the following tokens:

manual/Tokens.txt · Last modified: 2019/07/01 01:07 by peternlewis