PURPOSE
This macro will paste a Keyboard Maestro token into a field that accepts text (or into the Clipboard if the cursor is not within a text field).
The macro begins by using a Prompt With List that includes all of the tokens and their respective descriptions. Once a token is selected, a dialog appears that presents three options for the format:
Format 1
%Token%
Format 2
Token [%Token%]
Format 3
Token
┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈
%Token%
Format 1 is typically used in a Set Variable to Text or If Then Else action, whereas Format 2 and Format 3 are typically used in a Display Text action, the latter useful when the token value may contain multiple lines.
TESTED WITH
• Keyboard Maestro 10.2
• Ventura 13.4.1 (22F770820d)/MacBookPro16,1
• Mojave 10.14.16/Macmini6,2
• High Sierra 10.13.6/iMac11,1445
VERSION HISTORY
1.0 initial version
The latest version of this macro is available on the Keyboard Maestro Forum.
Download: Insert Token.kmmacros (47 KB)
Macro-Notes
- Macros are always disabled when imported into the Keyboard Maestro Editor.
- The user must ensure the macro is enabled.
- The user must also ensure the macro's parent macro-group is enabled.
System Information
- macOS 13.4.1 (22F770820d)
- Keyboard Maestro v10.2
When the macro is triggered, a list of tokens/descriptions is displayed.
After a token is selected, a dialog will be displayed that is used to select the token format (unless Format 1 was specified above using the Shift key (⇧) when selecting the token).
Note that the format can be selected by clicking one of the dialog buttons or using the keyboard:
- Cancel : <esc> key
- Format 3 : 3 key
- Format 2 : 2 key
- Format 1 : <return> key