User Tools

Site Tools


manual:Tokens

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
manual:Tokens [2019/06/18 01:34]
peternlewis
manual:Tokens [2019/07/01 01:07]
peternlewis
Line 2: Line 2:
  
 Tokens allow you to add textual information to [[/​Text_Fields|token text fields]]. ​ You can tell that a field accepts tokens because a small BUTTON{{{T}}} shows in the field while editing it. Tokens allow you to add textual information to [[/​Text_Fields|token text fields]]. ​ You can tell that a field accepts tokens because a small BUTTON{{{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 [[Menus#​Insert_Token|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 [[Menus#​Insert_Token_by_Name|Edit ➤ Insert Token by Name menu]]. You can insert tokens into a field using the Insert Token popup near the field or by choosing from the [[Menus#​Insert_Token|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 [[Menus#​Insert_Token_by_Name|Edit ➤ Insert Token by Name menu]].
Line 7: Line 9:
 The available tokens are listed on the [[/​Tokens|wiki Tokens page]]. The available tokens are listed on the [[/​Tokens|wiki Tokens page]].
  
-Text token fields also process %NN% or %NNNN% as arbitrary hex unicode characters (eg %41% is an A), 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).+==== 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 (\\). 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 [[action:​Search_and_Replace|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: 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:
Line 23: Line 45:
 * [[token:​CurrentMouse|CurrentMouse]] * [[token:​CurrentMouse|CurrentMouse]]
 * [[token:​FoundImage|FoundImage]] * [[token:​FoundImage|FoundImage]]
- 
-Many actions allow you to turn off tokens or backslash character processing if you need to use text that has percent or backslash characters. ​ You can control this by clicking the BUTTON{{{⚙}}} button and using the action menu. 
- 
manual/Tokens.txt · Last modified: 2023/10/02 00:10 by peternlewis