Keyboard Maestro 6 IconKeyboard Maestro 6

Conduct your Mac Like a Pro!

Text Tokens

Text Tokens allow you to add information to text fields. You can insert text tokens into a field using the Insert Token popup near the field.

The available text tokens include the following:

%Variable%Variable Name%
the value of the variable, see the Variables section.
%Calculate%1+2%
perform a calculation and use the result, see the Calculations section.
%CurrentClipboard%
the text of the current clipboard.
%PastClipboard%1%
the text of a past clipboard.
%NamedClipboard%Clipboard Name%
the text of a named clipboard.
%LongDate%
the current date in long format.
%ShortDate%
the current date in short format.
%NumberDate%
the current date in numeric format.
%LongTime%
the current time with seconds.
%ShortTime%
the current time without seconds.
%ICUDateTime%EEE, MMM d, yyyy%
the current date and time in any ICU date format.
%ICUDateTimePlus%3*6%Hours%EEE, MMM d, yyyy%
an offseted date and time in any ICU date format. Offset may be in Seconds, Minutes, Hours, Days, Weeks, Months, Years.
%ICUDateTimeMinus%3*6%Hours%EEE, MMM d, yyyy%
same as ICUDateTimePlus, but subtracts the offset.
%ICUDateTimeFor%NOW()+20%EEE, MMM d, yyyy%
a specific date and time in any ICU date format.
%UserName%
the current user name.
%UserLoginID%
the current user login id.
%MacName%
the current Mac name.
%MacIPAddress%
the current Mac IP Address.
%MacUUID%
a unique ID for this Mac.
%AddressBook%Name%
your AddressBook name.
%AddressBook%First%
your AddressBook first name.
%AddressBook%Last%
your AddressBook last name.
%AddressBook%Nickname%
your AddressBook nickname.
%AddressBook%Organization%
your AddressBook organization.
%AddressBook%Note%
your AddressBook note.
%CurrentApplication%
the name of the current application.
%LastApplication%
the name of the last application.
%Application%n%
the name of the nth application.
%FrontWindowPosition%
the position of the front window.
%FrontWindowSize%
the size of the front window.
%FrontWindowFrame%
the frame of the front window.
%FrontWindowName%
the name of the front window.
%WindowPosition%n%
the position of the nth window.
%WindowSize%n%
the size of the nth window.
%WindowFrame%n%
the frame of the nth window.
%WindowName%n%
the name of the nth window.
%CurrentMouse%
the current mouse location.
%Screen%Main%
the frame of the main screen.
%Screen%Second%
the frame of the second screen (first from the left excluding the Main one).
%Screen%Third%
the frame of the third screen (second from the left excluding the Main one).
%Screen%Internal%
the (left-most) built-in screen.
%Screen%External%
the (left-most) non-built-in screen.
%Screen%Front%
the (left-most) screen containing (the most of) the front window.
%Screen%Mouse%
the (left-most) screen containing the mouse.
%Screen%2%
the frame of the second screen.
%SystemVolume%
the current system volume.
%NetworkLocation%
the current network location name.
%NetworkLocation%
the current network location name.
%FindPasteboard%
the current system find pasteboard value.
%CurrentTrack%name%
the current iTunes track name.
%CurrentTrack%artist%
the current iTunes track artist.
%CurrentTrack%album%
the current iTunes track album.
%CurrentTrack%ratingstars%
the current iTunes song rating.
%SafariTitle%
the title of the current Safari tab.
%SafariURL%
the URL of the current Safari tab.
%SafariReadyState%
the ready state of the current Safari tab.
%SafariField%
the value of a field in the current Safari tab.
%SafariJavaScript%
the result of some JavaScript executed in the current Safari tab.
%ChromeTitle%
the title of the current Google Chrome tab.
%ChromeURL%
the URL of the current Google Chrome tab.
%ChromeReadyState%
the ready state of the current Google Chrome tab.
%ChromeField%
the value of a field in the current Google Chrome tab.
%ChromeJavaScript%
the result of some JavaScript executed in the current Google Chrome tab.
%MailRecipients%
comma separated list of the recipients in the currently selected mail message.
%MailToRecipients%
comma separated list of the to recipients in the currently selected mail message.
%MailCCRecipients%
comma separated list of the cc recipients in the currently selected mail message.
%MailBCCRecipients%
comma separated list of the bcc recipients in the currently selected mail message.
%MailSender%
the sender of the currently selected mail message.
%MailReplyTo%
the reply to of the currently selected mail message.
%MailSubject%
the subject of the currently selected mail message.
%MailContents%
the contents of the currently selected mail message.
%MailRawSource%
the raw source of the currently selected mail message.
%ExecutingMacro%
the name of the currently executing macro.
%ExecutingMacroUUID%
the unique ID of the currently executing macro.
%ExecutingMacroGroup%
the name of the macro group containing the currently executing macro.
%Trigger%
the trigger that fired this macro.
%TriggerBase%
the trigger type (eg "Typed String Trigger")
%TriggerValue%
the value associated with the trigger (eg the typed string, or the hot key pressed).
%ActionResult%
the success or failure of the immediate past action.
%|%
(that is a vertical bar) allows you to position the cursor after insertion.
%Tab%
the tab (0x08) character.
%Space%
the space character.
%LineFeed%
the linefeed (0x0A) character.
%Return%
the carriage return (0x0D) character.
%NN% or %NNNN%
arbitrary hex unicode characters (eg %41% is an A).
\a,\b,\e,\f,\t,\r,\n
characters (bell,backspace,escape,form feed,tab,return,line feed).

You can also use a short form of just %Variable Name% to include variables as long as there is no corresponding text token.

The index for windows and applications is from front to back when positive, or from back to front when negative.

To include a percent in your text, simply double the percent (%%). To include a backslash \ in your text, double the backslash (\\).

Continue on to Calculations

Close

Feedback Form

Please provide any feedback you may have


Email Address:
Subject:
Feedback:


Your email address is appreciated but is not required and will not be saved.
It will be used only for responding to or clarifying this feedback.

Documentation

Old Documentation